An implementation of undo and redo using the memento/command pattern