Undo/Redo pattern implemented

The undo and redo functionality of the application is now functional.