Do, undo and redo library for javascript