Support 'yaml' as a format for the Analyze API

Fixes #4311.

Copies the format of the `detailed` format, because putting the `text` format into yaml doesn't make much sense to me.