PY3: use six.BytesIO and six.moves.cStringIO

I've followed some code and found that most of the content are binary, so I use `six.BytesIO` here. I'm not sure if it's the best solution since it means `StringIO.StringIO` but not `cStringIO.StringIO`, so performance can be affected.

An alternative way would be a try-except block to import `cStringIO.StringIO` first, and fallback to `io.BytesIO`.