Fix handling of query parameters that are not S3 subresources

Fixes #515

Fix issue where the S3 rewrite module omits any query parameters that
are not S3 subresources. Also correct handling of query paramters so
that parameter values are not URL decoded twice. This primarily
affects pre-signed URLs because the access key and request signature
are included as query parameters. Also add two eunit test cases to
verify this issue is fixed and avoid future regressions.