Support duplicates, and DRY

Supporting duplicate parameter names ?param=2&param=1&param=3

Clean up duplicate code, dry.