Editor changes

Bunch of refactoring of the editor HTML/CSS.

This was all in preparation of doing #1522, but in the end I wasn't sure about the layout change.  I still want to merge the code because I think it's cleaner than before and makes it easier to make the layout changes later.