Bug 49411: Add a sanity check for expandtemplates responses

This patch adds a hack that lets us figure out the content language the API
used to expand a template. If that does not match our local content language,
it dumps some debugging information to the log that should let us hopefully
figure out if the problem is on our side or an API issue.

Change-Id: I52abbc10e5fe6a6b9d97ef6d842943809c8f6d6d
Abstract out the HTTP user agent and include Parsoid

This should make it easier to identify Parsoid requests in API logs.

Change-Id: I5761ed8f70f53c2cd487c6384b427085bed70f68