function encode(val) {
  return encodeURIComponent(val).
    replace(/%40/gi, '@').
    replace(/%3A/gi, ':').
    replace(/%24/g, '$').
    replace(/%2C/gi, ',').
    replace(/%20/g, '+').
    replace(/%5B/gi, '[').
    replace(/%5D/gi, ']');
}
Build a URL by appending params to the end

@param {string} url The base of the url (e.g., http://www.google.com)
@param {object} [params] The params to be appended
@returns {string} The formatted url