Added a helper function to manage subpaths in modulepaths.