Version 2.0: Seperation of state machine model and state

This enables the same state machine model to be used for multiple sets
of state; see README.MD for more information.