Fix exception when creating group and general cleanup
More bugfixing for groups
Restore reversed order of layers in layer list