Change persistence file format from binary to JSON

This commit changes the storage format for the PNOR activation
persistence file from binary to JSON so that it is human-readable
and parseable.

Change-Id: I7ad6bd9c34284cccd281707052b962c069f50676
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/serialize.cpp b/serialize.cpp
index e2e8bfd..8e95727 100644
--- a/serialize.cpp
+++ b/serialize.cpp
@@ -1,6 +1,6 @@
 #include "config.h"
 #include <experimental/filesystem>
-#include <cereal/archives/binary.hpp>
+#include <cereal/archives/json.hpp>
 #include <fstream>
 #include "serialize.hpp"
 
@@ -21,9 +21,9 @@
     }
     std::string path = PERSIST_DIR + versionId;
 
-    std::ofstream os(path.c_str(), std::ios::binary);
-    cereal::BinaryOutputArchive oarchive(os);
-    oarchive(priority);
+    std::ofstream os(path.c_str());
+    cereal::JSONOutputArchive oarchive(os);
+    oarchive(cereal::make_nvp("priority", priority));
 }
 
 void restoreFromFile(std::string versionId, uint8_t *priority)
@@ -31,9 +31,9 @@
     std::string path = PERSIST_DIR + versionId;
     if (fs::exists(path))
     {
-        std::ifstream is(path.c_str(), std::ios::in | std::ios::binary);
-        cereal::BinaryInputArchive iarchive(is);
-        iarchive(*priority);
+        std::ifstream is(path.c_str(), std::ios::in);
+        cereal::JSONInputArchive iarchive(is);
+        iarchive(cereal::make_nvp("priority", *priority));
     }
 }