Sort modules by name during scan for repeatability.

This should ensure directives are executed in a consistent order across runs.