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)
@ChrisBeaumont - I'm not too familiar with Pandas so feel free to make the change. If possible I think it would probably make sense to have a compatibility 'unique' function in the utilities that can be called from here, to limit the number of places where we are dependent on pandas (and in future we can switch the compatibility layer back to using Numpy once they have fixed it).