Ported to irclib.

Also fixed up python 2 support.