Python3 compat

This seems to work in python2 and python3...
The `im_func` was necessary for 2.x. Apparently 3.x doesn't have unbound functions, replaced it with `__func__` which is apparently the correct thing in 3.x and that works fine in 2.x. Can you test it for me on your rig?