Initial work on refactoring app-state handling.
Add initial implementation for application wide state transition.