Renamed toJson/toPrettyJson to writeJsonString/writePrettyJsonString and improved the ddoc comments.
Removed uses of toPrettyJson (replaced by writePrettyJsonString).