Rewrite the http factory to fix a bug where config objects weren't isolated per request