Move the HTTP code to a separate module.