replace json_encode function - .net 2/3 compatibility

To make the code compatible with older versions of .net Framework.

Doing so does not need to copy the dll "System.Web.Extensions.dll".