add getRequiredModules method to Module.