Use StringIO from six for Python 3 support