Fix issue with query string duplication method [RD-52]

I could really use some more eyes on this. In the process of fixing the issue at hand, I ran into some more issues. One is that the value that is intended to be a query string might start with a bit of path. I've fixed that at redirect/helpers.py line 196, but I'm sure there are more issues than just that.

All tests pass. The previous failures that I've tested have worked.