Python 2 support

I  made some minor tweaks to the http code so it supports Python2's httplib instead of relying on the Python3-only http.client module.