Engine tests

This includes a bunch of tests for the game engine code.