Add Python 3 support

This adds Python 3 compatibility. Thanks for the module.