Refactored Statechart.init to init and initStates so that initialization...

... can be run independently.