Made it so parameter lists are traversed only once.

The list insertion methods call for TraversableOnce, but we were looping
over them multiple times if the parameter name appeared more than once
in the query. This implementation does not do that.
CR: Sriraam