re-designed httpdownload.py and test/test_httpdownload.py

I changed the two files based on reviews.