added build_url method that constructs a url and properly encodes
querystring params.