Tidy up conversion from the datastore, properly decode strings when reading them back