Python 3 support

Its working, but I am not sure if its bug free