Add instance copying, fix instance creation (with identical names)
Implement instance sorting options.
Reformat and (slightly) decruft all the things.