Switch the spec-metadata block generation to using a consistent dict-based API. Custom keys can now merge into existing keys.