Fixes to state-machine.js docs