Move some of the former LegacyExtensions into the ImageJ2-specific hooks

Our ultimate goal is to separate concerns; that means that patches for
ImageJ 1.x that are independent of ImageJ2 should go to the essential
legacy hooks while extensions that actually require ImageJ2 go to the
DefaultLegacyHooks class (so that we can factor out the patcher itself
into a separate project).

In this vein, let's move certain extension points we just moved out of
LegacyExtensions further into DefaultLegacyHooks, e.g. the editor hooks.

Basically everything we will want to implement via the SciJava-common
plugin framework needs to be handled by DefaultLegacyHooks.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: remove obsolete code

In our endeavor to separate better between ImageJ 1.x and ImageJ2
classes, we no longer use ImageJ2 classes directly in the patched
ImageJ 1.x.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
IJ1Helper: remove no longer needed functions

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Script editor: defensive programming

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Attach/detach the event delegator when installing the legacy hooks

It is more logical to do it that way because it guarantees that the
event delegator is detached even if hooks are installed into ImageJ 1.x
that are *not* based on an ImageJ2 legacy service.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a default implementation of the text editor

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Add a class loader specifically for loading a patched ImageJ 1.x

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Add a class to facilitate working with multiple ImageJ 1.x instances

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Add a test for calling a fresh headless ImageJ 1.x

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

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