[WIP] Fixed #24020 -- Use expressions inside the compiler; refactor select_related() implementation

This pull requests does two important changes to the ORM:
  1) The ORM uses internally expressions. SELECT clauses are expressions, ORDER BY clauses are expressions and so on. The conversion to expressions is currently done in the compiler to keep the scope of the
patch somewhat manageable.
  2) The way select_related() queries are implemented is refactored. The compiler sets up the query, and the QuerySet iterator() uses the data generated by the compiler. Previously both the compiler and the iterator calculated the select columns which resulted in a bad DRY violation (not to mention the old get_cached_row()/get_klass_info() code was extremely ugly). The new way is 30% faster on djangobench query_select_related tests.

I had to touch the way database converters are implemented. Nothing drastic has changed in there.

What works currently:
  - tests pass on SQLite and PostgreSQL. They likely fail on Oracle

What needs to be done:
  - refactor gis. It should be possible to get completely rid of gis Compiler classes, and significantly improve the way gis QuerySet is implemented. There is a lot of work to do as we have to effectively rewrite gis to use expressions.
  - fix remaining failures on non-gis backends
  - check if the patch can be splitted to more manageable chunks
This is existing code. The thing is, on MySQL it is enough that you have GROUP BY "some primary key column" in the query when aggregating, except for some reason columns in HAVING clause must be mentioned in the GROUP BY clause. PostgreSQL has similar group by primary key feature, except that the PostgreSQL version requires that the primary key of *each* table needed in the GROUP BY has its primary key added to the GROUP BY.

Still, this line isn't needed now.