change from simplejson to gjson (so we are consistent with CLAVIN code), better error handling, more constants