[1.7.x] Removed usage of deprecated django.utils.importlib.

Backport of 1e84d261d6 from master
[1.7.x] Fixed #22750, #22248: Model renaming now also alters field FKs
[1.7.x] Gave unique names to SpatialRefSysModels.

Prevented clashes in the app registry.

Fixed #22790. Thanks timo for the report.

Backport of 6e5651e from master
[1.7.x] Fixed #22777: Add dependency on through for autodetected M2M adds