Refactored gamestate processing

Ready to merge