AST rewrite for COUNT DISTINCTs.
Some tests for COUNT DISTINCT AST rewrite.