Support for Python 3

I have made a few modifications that I really don't know if it's only for Python 3.

I'm not so sure about the dot before the module's name in import, but without it Python throws an ImportError, and about the ping right after the connection is open, but without doing it, it takes too long to subscribe to channel, receive data, etc.

Feel free to reject the pull, or make your own modifications.