refactoring
Disambiguation layerId = layer id string, layer = MapLayer object instance
Use the new MapLayer objects when working with layer definitions
Make the getLayerById function "public"