Major code cleanup

Switched to Omeka form, fixed several bugs, commented everything.
Haven’t tested actually editing metadata, but previews certainly work
as before.