Indent fix
Make sure strings are properly escaped in json

Unfortunately the json serialization is quite fragile, so we cannot
easily ensure correct json output:( Closes #28.