Refactor module assembly loading logic to allow the whole module to be loaded in a custom ALC (#16889)