Wiped get_commands() cache when INSTALLED_APPS changes.

Refs #21018, #21688.
Fixed #21018 -- Reversed precedence order for management commands.