Better page URL generation.

This adds tests for #197 and may also address issue #182. It does so
by changing the URL generation to remove the page query parameter
when present. If the generated URL uses the page number in the URL
directly, it will always be present. This also leads to a possible
resolution for #44.