Refactored classes, moved things around.

Things are slightly better organized for further development.