Merge pull request #12 from m1ch1/master

Implement StateMachine.stateChanged.
Only reply the request sent by its own and clear pending queue when recovering.
Merge pull request #13 from EasonLiao/simple_test

Only reply the request sent by its own and clear pending queue when reco...