Add absolute url test and fix docstring - thanks @manishtomar
Move the sorting of query args into its own function - thanks @manishtomar