Inline agg

This is part 1: Serial Inline aggregation contain table agg and group by agg with index.

Waiting for Jenkins.

split this into two simpler functions for top and dist -- the caller always knows which one it wants.