Add newline_values_only and flaten output methods.

Fixs #9443.