Add a method to the LegacyEnvironment to apply the patches

When the caller wants to use (patched) ImageJ 1.x classes, but not start
ImageJ 1.x, nor run a macro or plugin, this method can be used to force
the patches to be applied. Further configuration of the
LegacyEnvironment is no longer possible afterwards.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add API to instantiate a new ImageJ 1.x without running main()

In some cases, we definitely want to disable command-line argument
processing, and just get a hidden (or even headless) ImageJ 1.x
instance. This method allows that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a method to check for a running ImageJ 1.x instance gently

Callers who want to run a patched ImageJ 1.x and want to verify that
there is not yet a running ImageJ 1.x instance need to be very careful
*not* to load any ImageJ 1.x classes to perform that check. In
particular, the caller *cannot* test `IJ.getInstance() != null`.

The method `LegacyEnvironment#isImageJ1Initialized(ClassLoader)`
performs such a careful check: if it returns true, there is already
a running instance. If it returns false, we can still apply patches.
If the ImageJ 1.x classes were already loaded, unpatched, this method
throws an exception.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'legacy-startup'

This topic branch brings a couple of convenience methods to allow for
different ways to start the patched ImageJ 1.x instance.

Some of these methods will be required by the next iterations of
imagej-legacy's DefaultLegacyService.

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