start cleaning up after the demo rush
Some more refactoring progress... things got a bit intertwined, there
are several refactoring-related quick hacks that will need to get
cleaned up in a second round.
slowly reapproaching sanity