WIP: merge imageutils into astropy core

This is a WIP, but is the PR to merge ``imageutils`` into the Astropy core package.

Notes:

* I have attempted to preserve the history but removed code that simply affected affiliated package infrastructure code.
* The branches and merge history *within* imageutils is lost since I rebased this, but I think this is actually less confusing this way. We just have a linear history for the package.
* I also updated issue numbers in the commit messages to always include ``astropy/imageutils``
* This does not include lacosmicx which can be added separately once the licensing is sorted out. Doing that separately will make reviewing this PR easier anyway
* It is marked as critical because this was assessed as 1.0-critical (not a critical bug though)

This is not ready for review or merging, and still needs updates to the docs, tests to pass, etc.

cc @larrybradley @cdeil @adonath @eteq @hamogu @ejeschke

Hmm, for me, numpy is *far* faster both with very large and small images. I think this needs a bit more thought, so remove it from the PR?
```
In [3]: image = np.arange(100000000.).reshape(10000, 10000)

In [4]: %timeit downsample(image, 10)
1 loops, best of 3: 323 ms per loop

In [5]: %timeit image.reshape(1000, 10, 1000, 10)[:,0,:,0].copy()
100 loops, best of 3: 5.66 ms per loop
In [6]: image = np.arange(10000.).reshape(100, 100)

In [7]: %timeit downsample(image, 10)
100000 loops, best of 3: 11.3 µs per loop

In [8]: %timeit image.reshape(10, 10, 10, 10)[:,0,:,0].copy()
100000 loops, best of 3: 3.14 µs per loop
```