Initial work on the StateController.
merge