Refactoring: StateManager

Refactor out StateManager, update grid, pathfinder, and engine