I'm not dead yet

Removed most (if not all) global variables and replaced it with a game
engine class. A few ordering issues taken care of.