Add extra validation for CJSON fields

Check that required fields are provided. Only
access sub fields if parents exist. Provide
validation errors in error string.

Change-Id: I25c54c9d3f1b40812aac4be81ed6766bb145b726
Check return value from read and write calls

Add EXPECT_XXX(...) for return value and error
string to help in the diagnosis of failing test.

Change-Id: I26e4d31adfb0a4f6460962780e28352850a14ca7
Merge topic 'cjson-error-reporting' into master

9a9b9a98 Check return value from read and write calls
2f8cac8b Add extra validation for CJSON fields