Initial implementation of struct-type contract generation.

Also it is not obvious to me that importing a struct-type with no higher order protection is sound. Is this relying on the fact that we cannot do anything in a typesafe way to a value of `StructTypeTop`?