IO update

Addition of Serialization of data structures for simpler flattening for
storage in text file