Add support for DISTINCT in aggregations for simple cases

Supports COUNT(DISTINCT) and DISTINCT in other aggregations, as long as
there is only one DISTINCT expression, and all the aggregations use this
expression. Also, using it with GROUP BY is not supported yet.