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.
I will use `dummy` instead of `_`. `dummy` avoids the clashes mentioned in the style guide, is more obvious than an underscore and is recognized by pylint by default.