Update to python 3

Hi there,
I got some errors when I tried to use pyrc with a python 3 project, so I made a few changes for it to work with python 3. Though it probably breaks backward compatibility with python 2, so I dunno if you'd want to merge it.

Anyway, no pressure, just thought I'd put it out there :)