Added a submodule search function and moved the mainModule search one into the config object, it make more sens.