refactor aggregation functions and tidy

aggregation functions now class methods of Form13F
functions now pure, no globals