Refactors the high level game logic, and style/comment changes