Implemented exit and created GameMaster to handle global state events.