Refactored based on Erik's fork, added Game class, Log class, cleaned up a lot of code.