Switch to new way of storing layout

This implements the new layout data structure discussed in ticket 1522, and makes it possible to place multiple blocks in a column. It also integrates @forresttanaka's new positioning of the edit button.

And it fixes some bugs in layout editing (tickets 1555, 1556, 1557, 1558) and makes 1563 a non-issue.