More work on refactoring the game engine for testing.