Add a subclass of goog.ui.Dialog for testability.

Offers a "test mode" where expected dialogs are automatically dismissed
with a preselected response, and unexpected dialogs cause an exception
to be thrown, to track them down and avoid leaving tests hanging.