AllLayers.js deals with different layers in customized ways. I think we could restructure to detect some layers which are groups containing multiple other layers, or most other layouts, automatically.
There is also custom logic lower in the file for handling groupedOverlayMaps like openInfrastructureMap -- I think we could solve this in info.json with a standardized way of storing/describing grouped layers.