static SS decodeHQuery(S query) {
  new SS map;
  for (S s : splitAtAmpersand(query)) {
    int i = s.indexOf('=');
    if (i >= 0)
      map.put(urldecode(s.substring(0, i)), urldecode(s.substring(i+1)));
  }
  ret map;
}