Bug 1040598 - (Part VIII) Introduce StateManager