Fix a smorgasbord of bugs for more robust groupBy.

- Expand nominal types in the type of the left side of a GroupBy.
  This type is regenerated as a tuple of the grouping expressions, so
  it should never keep an existing nominal type (which can appear in
  case of an identity grouping).

- Fix typing bug in FlattenProjections. Not all occurrences of a
  flattened NominalType had their structural view replaced.

- Allow complex expressions inside of aggregation functions when
  detecting and rewriting groupBy calls in ConvertToComprehensions.

- Support grouping by integer literals in SQLite.

- Allow `max` and `min` aggregations on non-numeric types in
  QueryInterpreter.

- Treat StructTypes of a single column as single columns for the
  purpose of aggregation functions in QueryInterpreter. We already
  did this for ProductTypes.

Tests in AggregateTest.testGroupBy. Fixes issue #510.