Fixes to work with slicer 4.2
Avoid long computations by clamping min size

Spacing that is too small leads to very large resampled volumes
Remove incorrect comment
Remove testing code
Reorganize code for more efficient computation
ENH: Fix gradient calculation and optimizer

Now correctly determines step size with normalized value for
objective function and correctly finds local minima for
translations.
ENH: add comments of possible enhancements