Use Bytesio instead of stringio for python 3 compat