Separated key/value serialization from bsmedberg