#22477 Fix Incompatible Global Settings

Trac Issue: https://code.djangoproject.com/ticket/22477

This changes the value of `MIDDLEWARE_CLASSES` in the global settings to be in line with the default `INSTALLED_APPS` setting. While it is not fully backwards compatible it is unlikely to impact most users since `MIDDLEWARE_CLASSES` is overridden by the `startproject` command. A compatibility check has been added to warn users which have not set `MIDDLEWARE_CLASSES` and rely on the defaults.

I've kept the original commits but if accepted I'm happy to squash them into one. Since this problem is exposed by the app-loading refactor I've submitted the PR against the 1.7.x branch. If that's a problem I'm happy to resubmit against master and move the docs and compatibility check forward to 1.8.