function setRoute(hash, replace, noConfirm) {
  let hashString = `${hash}`;
  if (hashString[0] !== '#') hashString = `#${hashString}`;
  if (replace) {
    window.history.replaceState('', null, hashString);
  } else {
    stack.push(Object.assign({}, route));
    window.history.pushState('', null, hashString);
  }
  updateRoute(noConfirm);
}
@typedef {Object} VMRoute
@prop {string} hash - entire hash without # e.g. 'path/name?foo=1&bar=2'
@prop {string} pathname - 'path/name'
@prop {string[]} paths - ['path', 'name']
@prop {StringMap} query - {foo: '1', bar: '2'}