Use string_types instead of basestring
Use 'as' in except clauses
Use six's xrange
s/file()/open()
Do not try to decode str in py3
Use iter[values,items] from compat
More string/bytes related fixes
Merge pull request #309 from ThiefMaster/py3-fixes

Various Py3 fixes