Added application state and toggleState method. Added simple manual test file.