Enable Py 3 compat, refactor function

Make code compatible with Python 3. Refactor the `subscribe` function. For exact details, please see the commit messages and commit diffs.
just a style thing here. it is recommended you use __ instead of _. 
http://docs.python-guide.org/en/latest/writing/style/#create-an-ignored-variable