Rearranges dependencies in modules and excludes lint InvalidPackage warning