Bump to pom-imagej 2.7

This also adjusts the code for the updated imagej-common 0.5.0.
Bump to next development cycle

Signed-off-by: Curtis Rueden <ctrueden@wisc.edu>
WIP: update pom.xml to 0.4.1
Update packages for 0.4.0

The imagej.legacy package is now net.imagej.legacy for consistency.
Updated all imports to match the new package structure.
Add a plugin type to intercept ImageJ 1.x' opening images

This plugin type will need to be implemented by all plugins wanting
to have a say how an image is opened.

It is our design to improve on HandleExtraFileTypes; Now developers
can extend ImageJ 1.x' image opening without stepping on each others
toes, badly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DefaultLegacyHooks: support LegacyImageOpener plugins

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

LegacyImageOpener was deemed too specific - we would like to be able to
open arbitrary sources using ImageJ2's opening mechanism. Thus what we
really want is a "LegacyOpener" and a DefaultLegacyOpener
implementation that will run the IJ2 OpenFile command on a given input.
DefaultLegacyHooks: intercept 3-param runPlugIn

Intercepting the 2-parameter ij.IJ.runPlugIn was insufficient for
intercepting commands executed from menu items, as these all directly
use the 3-parameter runPlugIn signature (which is trivially delegated to
from the 2-parameter signature).

Thus it makes more sense to intercept the 3-param signature, allowing us
to override behavior from any menu item.

NB: an IJ1Helper is used to shelter the ij.plugin.Commands import from
the DefaultLegacyHooks.
DefaultLegacyHooks: intercept open command

If the ij.plugin.Commands open method is executed, we will now intercept
and delegate to the interceptOpen method, allowing LegacyOpeners to be
used.
DefaultLegacyOpener: avoid display postprocessing

We want to run the IJ2 open command with all preprocessors (and the
capactiy to include postprocessors) except DisplayPostprocessors, as
these will cause the IJ2 GUI to display an image.. which will then
typically be displayed again by IJ1.

To work around this, we blacklist DisplayPostprocessors by removing them
from the PluginIndex while running OpenFile. The postprocessors are then
returned to the index after execution.

When ready, the LegacyUI should handle this more appropriately.