ENG-3838 Add json function edge and error test cases, mostly re: r=ssantoro