simplistic port of generateJson.py (generates aggregates for topcat)