Implements canUndo()/canRedo()

Add undo/redo capability check to disable the buttons when not available.