Use six.moves for StringIO

This uses the six.moves interface for StringIO.

Testing done:
- Ran unit tests.
- Ran rbt post.

Reviewed at https://reviews.reviewboard.org/r/6608/