Making a bit of progress...

This changes the internals to use BytesIO over StringIO, which
fixed a few of the failing tests in Python 3.  We are only
importing from `io` now, instead of the entire chain, as this is
available in Python 2.6+.