JSON tweaks

Better to not hard code field names as strings in unmarshalling.
Make FieldsFactory exported.