Add method for smarter array allocation

This method checks its arguments to ensure the array being requested is
not too large in size.
Use DataTools.allocate in a few key places

Essentially, anywhere that allocates a byte array as a product of
integers is a good place to use this method, to avoid the product
overflowing beyond Integer.MAX_VALUE. The allocate method will throw a
more informative exception, and also catch cases we wouldn't have
before, where the product overflows back into positive ints.
Improve style and javadoc minorly
Split safe multiply check into separate method

This allows its use in a more general-purpose way, where byte array
allocations is not relevant.
Add safeMultiply method for longs

This allows for checking 64-bit overflows in addition to 32-bit
overflows.

Note that the safeMultiply(long...) method algorithm is a bit different,
since we cannot promote the running total to the next highest primitive
type (as Java has no 128-bit primitive integer type). Instead, we count
bits of the two operands and throw the exception if the multiplication
would overflow. This method is fast, but not quite as fast as the
safeMultiply(int...) technique, so we leave the 32-bit algorithm alone.
Use the more standard Java runtime variable
Merge pull request #31 from melissalinkert/bf-itk-fixes

BF-ITK build fix
Use the last n detector gains and offsets

This fixes the detector index so that the last n gains and offsets are
used, instead of the first n.

See #7897.
Check MicroManager metadata files more thoroughly

...so that we do not inadvertantly pick up files that do not really
belong to MicroManager datasets.

Noticed by Tom Kazimiers.
Fix configuration file path name checking

This allows the data tests to run again.
Only overwrite the channel count for non-RGB data

The user is allowed to do whatever they want to the dimensions in
ImageJ; sometimes, this means that the channel count is changed to 1
when RGB data is actually stored in the file.

Noticed by Tom Kazimiers.
Create log files as soon as possible
Add some extra diagnostics to the log file

The hope is that this will help to track down why a particular directory
is detected as being invalid.
Stop parsing tags if we have reached the EOF

Noticed by Anthony Luu.
Flip the planes upside-down

In carefully re-reading the MRC specification, the image origin is
assumed to be in the lower left corner (not the the upper left corner).
To correct for this, we now reverse the order of the rows prior to
returning the image.
Allow units to be specified as "micrometers"

Previously, only "um" and "microns" were allowed.  Since it's all the
same unit, allow "micrometers" too.

Reported by Glen MacDonald.
Fill in missing units for the C axis

Some software (notably Huygens) does not feel the need to write a unit
for the C axis.  This causes our poor ICS reader a great deal of
confusion, as the index into the array of units is now wrong.  So now we
check for a missing unit, and add in "nm" for the C axis as appropriate.

Reported by Glen MacDonald.
Parse the slice spacing and populate PhysicalSizeZ
Add missing 'break' statements

Noticed by FindBugs.
Add missing null check for the ND2Handler

Noticed by FindBugs.