core: Import cJSON code from the payproc project.