Features 2700, 2905 - bar x positions as in grid
A refactor leads to the (almost) same mechanism for BAR x-positions and GRID x-positions (#2700). This naturally closes #2905 (closed).
Follows !274 (merged). Closes #2699 (closed) and #2905 (closed), and progresses towards #2700. Also include parts of #2420.
cc @flothoni