I think it would be better to enforce that "group by", "avg by" and "sum by" contain unique items. as soon as one tag occurs in more than one place, we should tell the user "invalid query" (as an error on the resulting html page)

i.e something like ``` if len(group_by) + len(sum_by) + len(avg_by) != len(set(group_by + sum_by+avg_by))```

you don't necessarily have to do this in this PR. it can be a different PR (or i can do that part since i'm more familiar with the report-errors-to-user code)