Use map to determine valid transitions

This is a first step towards supporting multiple 'from' and 'to' states.
Allow multiple 'to' values
Allow multiple 'from' values
Unify assert style in specs
Create event methods only once
Initialize state machine with empty events table

It will be filled in the for loop, there is no need to copy the events
table from the options.
Rename and move some specs
Improve spec coverage for handler functions

The specs now check all possible handler functions.
Spies are used to simplify the assertions.
Support long and shorthand callback handlers

Before, only "onstate" and "onevent" were supported. Now "onenterstate"
and "onafterevent" can be used, too. They take precedence over the
shorthand versions if both are present.
Merge pull request #3 from theGoodEvil/multiple_from_to

Support multiple "from" and "to" states
add todot method

generates dot file (graphviz) for graphic representation of state
machine.
Merge pull request #6 from lipp/add-dotfile-generation

add todot method
Merge pull request #4 from theGoodEvil/support_all_handlers

Support onenterstate and onafterevent handlers