Implement StateMachine.stateChanged.
Merge pull request #12 from m1ch1/master

Implement StateMachine.stateChanged.