A jQuery undo/redo manager using the memento pattern