fixes #17 with a test

moved all the enable/disable logic into the one method. This keeps the fragmentation down. Also it only depends on the values in the undo redo count variables which I trust to be accurate.