Increments metadata object version numbers.

@param {Object} metadata The state.map.metadata.
@param {string} version The metadata object to be incremented.

@returns {Object} The new state.map.metadata object with the incremented version.
function incrementVersion(metadata, version) {
  const new_metadata = Object.assign({}, metadata);
  new_metadata[version] = getVersion(metadata, version) + 1;
  return {
    metadata: new_metadata,
  };
}