Undo/redo implemented (rough draft), still needs some tweaking in
exactly when to save, and in avoiding duplicate entries.