Move lib.http methods into http.js
jshint fixes
Improve comments