Refactored waiting for the next state logic.  Added unit test.
Merge branch 'master' of github.com:slipstream/SlipStreamClient