I have been neglecting my javascript state machine library for a few months while I wandered
the world (of Skyrim!), and a number of feature requests have come in that now deserve a
release - v2.1, that closes all the current outstanding github issues.

The code, along with updated usage instructions are available on github.

By default, if you try to call an event method that is not allowed in the current state, the
state machine will throw an exception. If you prefer to handle the problem yourself, you can
define a custom error handler:

The onleavestate callback can now cancel the current event if it returns false.

NOTE: this breaks backward compatibility for asynchronous transitions, which used to return false
in order to trigger an asynchronous transition, but now need to return StateMachine.ASYNC instead
of false