Replaced cJSON with homegrown JSON library