Node's [url.format](http://nodejs.org/api/url.html#url_url_format_urlobj) is great for building