python 3 compatibility

This has merged astroquery #221 from Christoph, but is my ongoing effort to make py3 tests green