Add facet calculation to unified search API

This adds support for supplying facet_<fieldname> parameters to the API,
which return counts of the top values in that field in documents which
match the query.

This is designed to support multi-select facets in the API, and to
support having several active facet fields at a time.  To do this
correctly, the "filters" part of the request payload sent to
elasticsearch needs to contain only filters related to facet fields.
Any other filters are now included in the "query" part of the request
payload using a "filtered" query in elasticsearch.