WIP rewrite LegacyImageMap

Legacy and modern mappings were being conflated, so as to always create
hard references to an ImagePlus - even in legacy mode. These references
would not be cleaned when in legacy mode, resulting in memory leaks.

What we want is, in legacy mode:
* hard references to displays so they aren't GC'd
* Weak references to ImagePluses so they are cleared when the referent is
  closed in IJ 1.x.
* Weak mappings from the ImagePluses to displays, so that when an
  ImagePlus is gc'd its shadowing display is gc'd as well
* registration of the displays in legacy mode, so that the IJ2 framework
  picks up the shadowing display (e.g. for populating @parameter Datasets
  in scripts).

In modern mode:
* hard references to imagepluses so they aren't GC'd
* weak references to displays so they are cleared when the referent is
  closed in IJ2.
* weak mappings of the displays to the imagepluses so when the display
  is removed, the corresponding imageplus is disposed as well

switching to modern mode should thus be a matter of translating between
these mappings.

Also need to ensure mappings are cleaned up when referents of weakrefs
are gc'd.