add state machine with order and spec
add state machine from scratch
delete origin
update the spec test
Merge pull request #197 from xiongbo/master

finished 392