code to translate back to json, addresses #5
editing value fields (still need key)