Array.groupby

We should probably remove Array.aggregate to reduce confusion, but for now
I'll keep aggregate for error checks.