implement lodash's .reduce for url query string construction