Documented state-machine.js