Py3k-friendly use of StringIO. Remove unused imports.

This was done manually. Note that Python 2.7 has an io.StringIO class, but it's strictly Python3-compatible and deals in Unicode strings instead of bytes, so I preferred the classic cStringIO implementation for Python 2.

For the modules where StringIO was imported but not used, I just pruned them.
I had a background thread worrying about that :-/

Once I get the syntax errors out of the way, we'll see how it goes. Thanks for the heads-up!