Reworked undo/redo, close #13.