Added feature that saves application state to file