NF: context manager for imageglobals error level

Context manager to set and unset imageglobals module constant
TST: add test for outputs from header scaling

I'm about to refactor the header scaling dramatically, but I don't want
to change the default output from given input header scalings.  Check
the output from some odd header scalings before the refactor.
RF: move slope inter and scaling tests to classes

Slightly expand test coverage by moving checks of slope and inter, and
of scaling, from functions to methods of the header test classes.
RF: break up nifti tests to ease refactoring

Break up nifti tests into separate methods for easier refactoring.

Add helper test function for checking no log errors
RF: expand scaling checks in get_slope_inter

Make header `get_slope_inter()` do checks for non-finite etc scaling for
all Analyze types.

Raise error in `get_slope_inter` if there is a valid slope but invalid
intercept.  This is the default when reading a header from disc from the
log checks, but I'm going to remove the log checks soon, and I want to
preserve the logic set in `TestAnalyzeImage.test_header_scaling()`
RF: remove all log checks and fixes for scaling

We're going to allow NaN as a valid slope and / or intercept. Up until
now we've ignored slope and intercept values in writing the image.

For simplicity, remove all header log checks and fixes for scaling.

Do all necessary reinterpretation of scale factors in `get_slope_inter`
RF: allow None as input to apply_read_scaling

Else where we've used None as shorthand for no scaling, so allow None
for slope and intercept in apply_read_scaling function.
RF: allow NaN in header.set_slope_inter()

NaN will the be signal to allow the image to do scaling on write, so
allow NaN as an input value to `set_slope_inter`
RF+API: NaN slope/inter default in set_slope_inter

Make NaN the default for slope and intercept when passing Nones to
`header.set_slope_inter()`
RF: allow integer slope, inter in array_to_file

Integer intercept with slope==1 previously caused errors when checking
the intercept type, because the intercept check was not expecting an
array. Squeeze the intercept array for the check.
RF+TST: text and fix int to int without scaling

I wasn't clipping the arrays properly when doing int to int scaling
with identity scaling.  Test and fix.

Add test for non-numeric input dtype.
RF: default arguments for private function

Make default arguments to mn, mx arguments of _dt_min_max function for
convenience.
BF+TST: make sure longs work in slice objects

Use Python 2 / 3 compatible check for integer slices to make sure that
Python 2 long objects work as slice definitions.
RF: make sure longs allowed for int_to_float

Use six 'integer_types' for isinstance check when testing for integers.
NF: add check_scaling keyword to ArrayWriter

Let user tell ArrayWriter to continue even if the array needs scaling
for write of full range.
RF: stop array_to_file using float16 working type

Don't allow float16 as a working type (it's about 10 times slower than
float64).  Instead of upcasting input implicitly with the slope and
intercept, upcast explicitly during write.
TST: test array_to_file scaling & no scaling cases

Add tests for array_to_file scaling in the simpler cases, and when not
scaling at all.
RF+API: no finite thresholds for no-scale writer

ArrayWriter can't use scaling, but had a generic 'scaling_needed'
function that assumed that arrays of all nans, infs will get set to
zero, because of the behavior of the ``finite_range`` method.

This makes sense if we are scaling, because then it is most sensible to
scale to the largest / smallest non-finite value.  For no-scaling, it
makes more sense to clip any values outside the dtype range to the max /
min.

Implement this and test.

This is a very minor API change, because ArrayWriter until a few commits
ago raised an error for any float to integer conversion that wasn't an
array just composed of non-finite values.  So, the only change of
effective API is that arrays of non-finite values passes to ArrayWriter
now raise a WriterError by default, instead of being quietly set to all
zero.
TST: add tests for array writer with no scaling

Test expected output for array writer classes when not using scaling.
RF+DOC: small edits for clarity to array_to_file

Comment edits, renaming variables for clarity.