Bugfixes and various optimisations

- Code clean up
- Sorting of image maps now robust and more versatile.
   - can be used with other item types
   - all items are sorted underneath the lowest one in the tree
Refactoring

- Loading files
- ENTITY mask and UDIM mask creation
- sort into mask groups
- code clean up