Extend type

Support for `extend-type` and all the infrastructure that goes around that.