Make folding of YAML headers configurable.

Also, make YAML headers folding more robust (don't fold on --- treated
as Delimiters, we could be outside of a YAML header.)