[MR] Properly escape JSON extracted values

When constructing documents with fields from JSON data, properly
escape chars (according to the JSON spec) to avoid invalid documents

Relates #311