Export data list containing arbitrary Mathematica expressions to JSON files

InputForm

Clear[validExpressionAsJSONDataQ,$EXPRWRAPPER,expressionToString,stringToExpression];
Clear[mengExport1,mengImport1];

$EXPRWRAPPER=stringifiedExpression;

validExpressionAsJSONDataQ[expr_?AtomQ]:=MatchQ[expr,Null|_String|_Integer|_Real]
validExpressionAsJSONDataQ[expr_]:=MatchQ[expr,{___?validExpressionAsJSONDataQ}]

expressionToString[a:Null|_String|_Integer|_Real]:=a;
expressionToString[exprList_List]:= expressionToString/@exprList;
expressionToString[expr:Except[_List]]:= ToString[$EXPRWRAPPER[expr],InputForm,CharacterEncoding-> "ASCII"];

stringToExpression[str_String]:=With[{regex=RegularExpression[ToString[$EXPRWRAPPER]<>"\\[.*\\]"]},Replace[str,s_?(StringMatchQ[#,regex]&):>(ToExpression[s]/.$EXPRWRAPPER-> Identity)]]

mengExport1[file_,expr_,"JSON"]:=Composition[
Export[file,#,"JSON"]&,
Map[#[[1]]-> Replace[#[[2]],rhs:Except[_?validExpressionAsJSONDataQ]:> expressionToString[rhs]]&,#]&
][expr]

mengImport1[file_,"JSON"]:=Composition[
Sort,
With[{regex=RegularExpression[ToString[$EXPRWRAPPER]<>"\\[.*\\]"]},Map[#[[1]]-> ReplaceAll[#[[2]],rhs_String?(StringMatchQ[#,regex]&):>stringToExpression[rhs]]&,#]]&,
Import[#,"JSON"]&
][file]

Clear[data];
data["test",0]=Sort@{"Name"->"ImageSearch","ServiceName"->"Flickr","DateTaken"->{{DateObject[{2015,1,1}],Today},{DateObject[{2015,4,4}],Today}},"Location"->{Entity["City",{"Miami","Florida","UnitedStates"}],Entity["City",{"LasVegas","Nevada","UnitedStates"}]},"MaxItems"->{1,2,3}};
data["test",1]={"k0"-> 1+2*I,"k1"-> "v","k2"-> v,"k3"-> 2,"k4"-> "2","k6"-> Null,"k7"-> {1,Null,"v73",{1,Null,"v743"}},"k8"-> {1,Null,v83,{"z",v842[v8421,"v8422"]}}};

Clear[jsonFile]
Table[
jsonFile=FileNameJoin[{$TemporaryDirectory,"test"<>ToString[idx]<>".json"}];
mengExport1[jsonFile,data["test",idx],"JSON"];
SystemOpen[jsonFile];
Sort@data["test",idx]===Sort@mengImport1[jsonFile,"JSON"],
{idx,{0,1}}
]

{
    “k0”: “stringifiedExpression[1 + 2*I]”,
    “k1”: “v”,
    “k2”: “stringifiedExpression[v]”,
    “k3”: 2,
    “k4”: “2”,
    “k6”: null,
    “k7”: [
        1,
        null,
        “v73”,
        [
            1,
            null,
            “v743”
        ]
    ],
    “k8”: [
        1,
        null,
        “stringifiedExpression[v83]”,
        [
            “z”,
            “stringifiedExpression[v842[v8421, \”v8422\”]]”
        ]
    ]
}

{
    “DateTaken”: [
        [
            “stringifiedExpression[DateObject[{2015, 1, 1}]]”,
            “stringifiedExpression[DateObject[{2015, 10, 27}]]”
        ],
        [
            “stringifiedExpression[DateObject[{2015, 4, 4}]]”,
            “stringifiedExpression[DateObject[{2015, 10, 27}]]”
        ]
    ],
    “Location”: [
        “stringifiedExpression[Entity[\”City\”, {\”Miami\”, \”Florida\”, \”UnitedStates\”}]]”,
        “stringifiedExpression[Entity[\”City\”, {\”LasVegas\”, \”Nevada\”, \”UnitedStates\”}]]”
    ],
    “MaxItems”: [
        1,
        2,
        3
    ],
    “Name”: “ImageSearch”,
    “ServiceName”: “Flickr”
}