Created common structure for state machines

By having a common structure for all state machines, the implementation
of the structure can change without having to change all the state
machine implementations and state machine builder implementations.  This
also hides the exact implementation from the state machine and builders.
Massive refactor to use state machine structure throughout
Updating README examples
Merge pull request #67 from bnorm-software/machine_structure

Created common structure for state machines