This strikes me as fragile - what if the URI we're appending to doesn't already have a query string? We need to be smarter about building sets of query string data.