Implented seal and unseal as a library.

It passes all but one test, since there is no way to make adding new fields to
an object after sealing throw an exception.