Add state manager, fix FPS font stuff and use var more