Added support for store

If store has TDDState, initialize currentState with it.
Also store updated state to store if it is defined.