Enable/disable undo/redo as appropriate

The menu item is now enabled/disabled depending on the context.

Closes #6.