add support for terms_stats facet and more dynamic association of facets to data series