get the module name from package, work with arbitrary number of packages