Fixes use of slow cJSON functions.

cJSON_GetArraySize and cJSON_GetArrayItem were the culprits.
fixed sscanf slowness
added error handling to parse_number
Merge branch 'json_optimizations' into next