Refactor JsonQueryFactory so that parameters are not expanded as text in the query string.

This allows preserving the actual types (e.g. longs aren't converted to ints, which was a problem for my use case) and speeds things up by avoiding a round trip through a text representation.