Fixes an issue where undo redo buttons state wasn't updated

This can happen when there is several instances of the editor.
Replaces registerUndo by registerUndoAction as it is deprecated
Makes use of the reset method of undo manager

Also removes an unnecessary call to updateState.