Implement stateManager in stateManager.cpp

Epic facepalm.