Aggregations: Adds ability to sort on multiple criteria

The terms aggregation can now support sorting on multiple criteria by replacing the sort object with an array or sort object whose order signifies the priority of the sort. The existing syntax for sorting on a single criteria also still works.

Contributes to #6917
You didn't introduce it, but seeing this line again reminds me that this is buggy if Long.compare returns Integer.MIN_VALUE, which is legal :) So  it should rather be `Long.compare(o2.getDocCount(), o1.getDocCount())` (without the minus sign)