Please correct me if I am wrong or missing something. It seems to me that the module name in the config file is primarily a "key" to identify the particular user/password pair you are using. So why not structure the config file thus:
in reply to Best practice with polymorphic constructors
(Or, you could specify a database or any other information in there.) Then you could retrieve the credentials based on the functionality, not the module name. Does that make sense?
<config user="fooser" pass="foo" />
<modify user="barser" pass="bar" />