Extract interfaces of Emitter and Parser.
Fix newline handling when emitting folded scalars.