I feel like query param string manipulation is all over this code... I would think maps everywhere, except at the exact points we go to/from an http request, so there's exactly one place where we have to deal with escaping and exactly one where we have to deal with unescaping...