Added writing capabilities to KeyValue object
Refactor KeyValue parsing and io functionality