Converted tabs to spaces, some cleaning up
Should work with python2 and python3 now. Removed httpQuery as it was completely irrelevant.