Sdss fixes python3

@mirochaj, I don't think I have changed any of the interfaces, but you might want to check.
I may still be able to clean the io.StringIO part a little more. Will let you know when ready to merge.