Sort `required` before running topological sort, or you'll end up getting various correct orderings. We want to have one ordering regardless of the order of the modules so it can be more easily cached on CDN.