State Transitional Machine for Elcodi.

This is an implementation of a State Transitional Machine and the intergration
with given Elcodi implementation.
Merge pull request #375 from elcodi/feature/state-transition-machine

Feature/state transition machine