Started moving state into separate file
Continued moving state refs
Moved most state functions across
Got it compiling after change
Added exit synonym for quit