Move HTTP code into http.go