LegacyEnvironment: apply legacy patches lazily

So far, ImageJ 1.x is patched completely as soon as the
LegacyEnvironment is instantiated. This is not always desirable,
however: in tests, for example, one will want to disable the
ij.plugin.dirs handling.

So let's prepare the LegacyEnvironment for "lazy" patching, i.e.
waiting with the legacy patches until ImageJ 1.x is accessed. We
can later add methods that exploit the gap between instantiating
the environment and "instantiating" ImageJ 1.x to modify the patches
according to the caller's wishes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Initialize a LegacyInjector with the LegacyEnvironment

This injector will hold information about selective legacy patching.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow disabling ij1.plugin.dirs handling

This is useful for tests, for example.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyEnvironment: Show trace of premature initialization

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor test environment instantiation

We have an awful lot of places where we instantiate a headless
legacy environment. In the next commits, we will want to disable
ij1.plugin.dir handling, so let's refactor first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use new API to disable ij1.plugin.dir handling in unit tests

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TO-UNDO: tentatively upgrade to ImageJ 1.48v

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