Apply results of running 'python-modernize'.

As well as additional fixups on the way toward "stradding" Python2 / Py3k.
this one's actually no good, right? (i.e. `types.StringTypes` should really become `six.string_types`)