Moved the game into an object instead of having just procedural code.