Pushed some generic code up from HttpQuery into new AbstractHttpQuery.

This will allow common HTTP-related functionality to be shared between
built-in HTTP queries and those from plugins.