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)
This is a bug in the original code -- the test should be `if row < len(self.dc.subset_groups)` (integer to integer comparison)