Implement Python 3 support #256