Refactoring to reduce file sizes

Things have been getting slow when editing; my guess is that it's
because each file is so big, that a lot recompiles with each keystroke.
So pulled apart the really big files into their constituent classes.