Add support for extend-type and extend-protocol.