Make sure that event handlers are not GC'ed prematurely

Unfortunately, our ProxySubscriber instances were garbage collected
rather quickly because there was no reference to them (references to the
event handler object do not prevent ProxySubscribers from being GCed).
So let's make sure that there are references to each ProxySubscriber as
long as there are still references to the corresponding event handler
object.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a unit test to verify that ProxySubscribers are not randomly GCed

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Adjust JavaDoc for the EventService

We do *not* need to hold references to the subscribers anymore.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
EventUtils: no need to hold the references to the event subscribers

It used to be necessary, but no longer!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
AbstractContextual does not need to hold references to event subscribers

We used to need that because the EventService would not hold references
itself. But we can easily hold a weak mapping between the event
handler objects and their proxy subscriber objects, which we do now.

This also gets rid of the finalize() method in all classes based on
AbstractContextual, which is a good thing!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Mention AbstractContextual in EventService#subscribe's JavaDoc

Rather than subscribing explicitly, most users will want to simply
extend AbstractContextual instead. So let's just have that hint in the
appropriate place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'weak-event-subscribers'

This branch obviates the need for every event handler to hold the
references to its event subscribers.

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