FIX: removeFiles building on all platforms
FIX: encoding of JSON strings with embedded newline or carriage-return.