Dialog windows tests

Plucked all of this code from within an `if (wdialog) {}`. More flat this way.