Improve performance of state transitions.
Refactor method names and improve performance test
Merge pull request #11 from jeremystone/master

performance improvement