hs descriptor encoder

We need something to construct hidden service descriptors. These have multiple phases of construction, which use different private key material. This will need some kind of multi-stage API.

Part of #683 (closed)