Migrate StringIO to six.BytesIO (has fallbacks), made use of more six defined types to simpify mapping