Patch adds ValueSourceFacetRequest which takes a ValueSource and creates a FacetsAggregator which aggregates by the values returned from ValueSource for documents. The app needs to specify whether the ValueSource requires document scores, and a matching aggregator is created accordingly.
Also added an example to demo/ of aggregating by an expression.
Note that this adds a dependency of facet/ on queries/ because ValueSource and FunctionValues are there. If they'll move the core/ one day, we can remove the dependency.