Give collect properties a mechanism to collect by

Without providing a collection mechanism (i.e. "mean", "sum" etc) then the values are returned as an array instead of a single value, which causes problems when it comes to sorting values in tables as arrays are casted to strings when comparing with `<`, and sorted as strings instead of raw numerical values.