Refactored some of the main game loop

* Added GameState struct
* Changed shuffle algorithm
* Generally moved stuff around
* Twiddled some bits