Support Python 3

StringIO module is deprecated in Python 3.
Use io.BytesIO or io.StringIO instead.
Bump version