Huge refactor of game internals

This pull request isn't close to ready for the prime time, but I wanted everyone to see what I've been working on. I'm updating how we test the game, by making the code more modular and more testable. I'd love to hear what you guys think.