Enable Python 3 compatibility

Make the StringIO import conditional. Add parentheses to print statements.
Refactor function "subscribe"

Try to make the function easy to read, and do make the function
pylint-compliant.
Merge pull request #38 from Ichimonji10/refactor-and-compat

Enable Py 3 compat, refactor function