Fixes for Py2.7: Use BytesIO instead of StringIO and encoding 'utf-8' instead of 'unicode'
Merge pull request #1 from rikva/master

Fixes for Py2.7: use BytesIO instead of StringIO.