Initial state machine code finished.
Merged initial SM code.
Merge pull request #3 from dagoodma/master

Initial SM integrated.