hide state implementation details from state context

* refactor StateFactory to make State from StateType
* cleanup and merged tests
Merge pull request #57 from foldlabs/refactor_state_factory

hide state implementation details from state context