state-machine updates

I had created my own version of state-machine.d.ts before you created yours. I have applied some of my implementation to yours.

These changes show the developer how to extend the StateMachine API that gets generated by the state-machine code automatically to include the events that are registered. It also puts some type-safety around the transition call to use during async events.

Also the is(), can() and cannot() methods take a string event name, not an event.

I preferred calling the configuration objects a StateMachineEventDef in order to save the StateMachineEvent name for the extension API calls. That's just a naming thing so could be done either way.

Have a look and see if you want to apply some or all of these.