More Python 3 fixes

This is a work in progress, and I am aiming to try and get the test suite to pass in Python 3.

Related issues:

* 
https://github.com/scikit-image/scikit-image/issues/1187

* https://github.com/numpy/numpy/issues/5145
* https://github.com/astropy/astropy/issues/3013

(jeez, this is turning out to be quite the bug hunt)