Fixed a couple flake8 warnings.
Refactored dumpdata with app configs instead of models modules.
Fixed #21692 -- Quote table name when creating it.
Avoided %r formatting on possibly unicode strings.

The u prefix looks bad on Python 2.
Merge pull request #2120 from ramiro/schema-creation-quoting

Fixed #21692 -- Quote table name when creating it.
Amend test table name so it doesn't clash.

Refs #21692 and 3efd1b8b939.
Simplified the implementation of register_model.

register_model is called exactly once in the entire Django code base, at the
bottom of ModelBase.__new__:

    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

ModelBase.__new__ exits prematurely 120 lines earlier (sigh) if a model with
the same name is already registered:

    if new_class._meta.apps.get_registered_model(new_class._meta.app_label, name):
        return

(This isn't the exact code, but it's equivalent.)

apps.register_model and apps.get_registered_model are essentially a setter and
a getter for apps.all_models, and apps.register_model is the only setter. As a
consequence, new_class._meta.apps.all_models cannot change in-between.

Considering that name == new_class.__name__, we can conclude that
register_model(app_label, model) is always called with such arguments that
get_registered_model(app_label, model.__name__) returns None.

Considering that model._meta.model_name == model.__name__.lower(), and looking
at the implementation of register_model and get_registered_model, this proves
that self.all_models[app_label] doesn't contain model._meta.model_name in
register_model, allowing us to simplify the implementation.
Updated the AppCommand API to support apps without a models module.
Migrated built-in AppCommands to use handle_app_config.
Used app_label instead of appname.

The last component of the dotted path to the application module is
consistently referenced as the application "label". For instance it's
AppConfig.label. appname could be confused with AppConfig.name, which is
the full dotted path.