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

Would it not be better to make this dimension-agnostic? This means iterating over the dimensions and returning tuples of slices. One advantage is that tuples of slices can be used to slice the image directly:
```
In [14]: image = np.arange(10000).reshape(100, 100)

In [15]: slices = (slice(10,20), slice(20,30))

In [16]: image[slices]
Out[16]: 
array([[1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029],
       [1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129],
       [1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229],
       [1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329],
       [1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429],
       [1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529],
       [1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629],
       [1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729],
       [1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829],
       [1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929]])
```