Python 3 support

I added a couple of .encode() methods where necessary to get Python 3 to work.  I also used requests to generate the json response instead of the standard json library.  I think this all should still work in Python 2.