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 (there's one exception that I still use StringIO for). I'm not sure if it's the best solution since it means `StringIO.StringIO` but not `cStringIO.StringIO` in Python 2.x, so performance can be affected.

An alternative way would be a try-except block to import `cStringIO.StringIO` first, and fallback to `io.BytesIO`.
The function take a param `unicode`, I suppose this was why `type(u'')` came out. But no idea about `isinstance` vs `type()` :/