Remove validation bits

Discard invalid properties from json decode. JSON output should only
contain valid properties. This saves time in preventing post
processing of output for valid fields.

Ensure round trip validity with validation bits removed and required
properties populated.

Fix bugs in json decode.

Overhaul unit tests to use valijson. Add tests with static examples
to validate against schema. Use and nlohmann for better schema
validation over intrinsic libcper validation.

Example json output before:
{
  "ValidationBits": {
    "LevelValid": false,
    "CorrectedValid": true
  },
  "Level": 1,
  "Corrected": true
}

After:
{
  "Corrected": true
}

Change-Id: I188bdc2827a57d938c22a431238fadfcdc939ab8
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/generator/cper-generate-cli.c b/generator/cper-generate-cli.c
index c9882c2..8c570ab 100644
--- a/generator/cper-generate-cli.c
+++ b/generator/cper-generate-cli.c
@@ -25,6 +25,7 @@
 	char *out_file = NULL;
 	char *single_section = NULL;
 	char **sections = NULL;
+	const GEN_VALID_BITS_TEST_TYPE randomValidbitsSet = RANDOM_VALID;
 	UINT16 num_sections = 0;
 	for (int i = 1; i < argc; i++) {
 		if (strcmp(argv[i], "--out") == 0 && i < argc - 1) {
@@ -73,9 +74,11 @@
 
 	//Which type are we generating?
 	if (single_section != NULL && sections == NULL) {
-		generate_single_section_record(single_section, cper_file);
+		generate_single_section_record(single_section, cper_file,
+					       randomValidbitsSet);
 	} else if (sections != NULL && single_section == NULL) {
-		generate_cper_record(sections, num_sections, cper_file);
+		generate_cper_record(sections, num_sections, cper_file,
+				     randomValidbitsSet);
 	} else {
 		//Invalid arguments.
 		printf("Invalid argument. Either both '--sections' and '--single-section' were set, or neither. For command information, refer to 'cper-generate --help'.\n");