addFieldToMetadata = (state, namePrefix) => {
  let tmpState = cloneDeep(state);
  let field = eval(`tmpState.${namePrefix}`);
  if (field === undefined) return tmpState.metadata;
  if (_.isArray(field)) field.push('');
  else field[`New field ${state.new_field_count}`] = '';
  return tmpState.metadata;
}
Returns the metadata of the state with the new empty field. If the field does
not exist, returns the original metadata. Does not mutate the given state.
@param {Object} state
@param {String} namePrefix
@return {Object} metadata