Fixes #21: Major rework of MAI format, generalization of layersets.