Gamestates and huge refactoring