Add undo and redo function

Undo and Redo function not completed yet. Might require undo and redo of
search and sort.