Add undo state hook

Adding a hook to track availability of Undo/Redo.