Added the dispatcher and save state controls to the state manager
Added tests for the dispatching functionality
Merge pull request #231 from hatched/state-controller

#### No QA