updated SubPanels to allow for increased flexibility

also changed LayerDefinition to generate LayerTemplates, not layers