Moved json_cmp() into unit test, so nobody accidentally uses it (it's O(n^2))
Revert "Moved json_cmp() into unit test, so nobody accidentally uses it (it's O(n^2))"

This reverts commit e329705b8e04708597fae7cfa2f7b24e0279dac6.
Revert "Revert "Moved json_cmp() into unit test, so nobody accidentally uses it (it's O(n^2))""

This reverts commit dc9e039bea7f24b28ee677dcb811d5af7d6d8d43.
Replaced inefficient uses of cJSON_GetArrayItem
Re-add json_cmp to main code base, but with fixed efficiency.

This reverts commit 1f0c4dbfb4d72060ffab9ec3149a68f169308093.

Conflicts:

	src/unittest/json.cc
Added missing file from previous commit
Small improvements to previous changes.