Main view refactor [RD-71]

This still isn't perfect, but it should be easier to work with. It will also create merge conflicts with everything else.

All tests pass and functionality remains unchanged.