Implemented Undo/Redo.
Refactored logger to be easier to use.
Refactored event handling loop to use actions.