Cleanup to IIIF code and some cosmetic improvements to generated JSON