Move some ij.IJ patches over from fiji-compat

This change makes sure that ImageJ 1.x is properly initialized when
calling macros in batch mode.

It also adds the ij.log.file handling: when this property is set,
IJ.log() will log not only to the Log window but also to the file
pointed to by the property.

While at it, runUserPlugIn() sets the context class loader for the
benefit of scripting languages and SezPoz (and therefore ImageJ2).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix ImageJ 1.x quitting in legacy mode

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