Escape line and paragraph separators when writing JSON.  Also, some documentation additions and style fixes