CodeHacker: add a writeJar() method including unpatched classes

In scenarios when javassist is not an option, we will want to write a
replacement .jar containing the patched classes. This method will help.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyInjector: add a static method to write out a patched .jar file

The code to write out a misc/headless.jar was not quite maintained when
moving the code from ij-legacy into ij1-patcher.

This change reinstates a public API to allow that, and as a bonus, it
also allows to include even the ImageJ 1.x classes that were not patched
as well as the resources needed to run it. In other words, running

	File jarFile = new File("ij.jar");
	boolean headless = false;
	boolean fullJar = true;
	LegacyInjector.writeJar(jarFile, headless, fullJar);

will write out an ij.jar that can be used *without* ij1-patcher.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Try to call FijiInitializer before LegacyInitializer

The default class to use as initializer in case the property
ij1.patcher.initializer is not set was the LegacyInitializer from the
ij-legacy artifact. However, when writing a fully patched ij.jar, we
will want to try FijiInitializer first (which will eventually cease to
exist in favor of moving everything into the LegacyInitializer context).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyInjector.writeJar(): handle ImageJ 1.x in a .jar file gracefully

So far, this topic branch was only tested in Eclipse, with ImageJ 1.x in
the workspace, i.e. available as an unpacked directory. Things change a
bit when running it outside, on .jar files.

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