When we use about:blank, the wait doesn't actually wait (because we
already did open about:blank earlier), so we need to use another URL or
this test will be flaky.
Fixes#1060.
In the process of adding this, I also decided to rewrite
mainwindow.get_window() for clarity (and also because flake8 was warning
about complexity).
Also adds some tests to the new-instance-target mechanism, in particular
a specific test for the issue in question.