Add Python 3 support

I haven't thoroughly tested this out but on the surface everything I used it for works.