Fix python3 compatibility

This branch fixes compatibility issues with python3 related to the usage of binaries instead of strings and also incorrect import for urlencode.

I was not able to fully test these changes against python2, and could not test all the affected providers. The only ones I tried were Facebook, Twitter and GoogleOAuth2.