(#18508) Create explicit dependencies before implicit

All of the explicit dependencies need to be added before any of the
implicit (autorequire) dependencies are processed. This is because we
skip an implicit dependency if it would interfere with an expicit one,
and if we don't have all of the explicit dependencies available the
system will end up creating implict ones that cause dependency cycles.