DEV: Order outputted theme stylesheets (PR #14133)

Followup to #13735, this sets a load order for theme (and theme component) stylesheets. As per the original PR, the load order is the following

  • remote theme components (ordered alphabetically)
  • remote main theme (if applicable)
  • local theme components (ordered alphabetically)
  • local main theme (if applicable)

Theoretically, this can cause unexpected style changes on sites with many themes and components but we have tested this internally with 100+ instances and did not run into any issues.