Generalize HttpCommon to be more useful for HttpClient

This will have a corresponding commit to HttpServer.