Undo and redo log implementation.