Fix the handling of json strings
I had a jsonEscape() function, which actually handles Json strings in an incomplete or wrong way. Hence problems if the string have unicode.
Since this program is mostly a json string caller to the Stash. So this fix is important.
Also have some other minor fixes.