Added Undo/Redo support (needs work).