Sorting package names to match folder structure