Switch to modern mode: only show modern UI if legacy UI was visible

This prevents the modern UI from popping up during the test phase when
building imagej-legacy on the command line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make sure that LegacyOpenerTest also preinits the legacy environment

This is needed to ensure that the runtime patches are applied properly,
no matter which unit test was run first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>