Made the StateManager to an interface, added some functions, and created a concrete class.