Added CJSON class
Various updates and bugfixes