Add SystemMode enum to track the current system mode.
Add open last document functionality.
Reorder members and methods in all classes.