Code refactoring; split half of main.cpp to game.cpp.