Made more progress on the core of the state manager and menu system.