Add Python 3 compatibility

StringIO moved to the `io` module in Python 3.
Merge pull request #8 from jonasvp/master

Add Python 3 compatibility