Source reorg

Piggy-backing onto #115, you're better off looking through the last 4 commits.

Just moves some stuff around to make the source nicer.