Add test for content setting and fix broken hide test

General tidy up: remove some of the commented code, redundant tests.
The ESC keyup event is being picked up by the dialog so have left a
note in there to look further into this.
Prohibit dialog from further opening/closing if open/closed