Proper JSON string escaping. Fixes #40