Mostly cleanup before submission

I plan to do a lot of refactoring afterwards to make things more
modular.