WIP StringIO improvements
Merge pull request #2096 from devinus/stringio

StringIO improvements