code: function format(str, args) {
          var keys = Object.keys(args), i;
          for (i=0; i<keys.length; i++) {
              str = str.replace(new RegExp("\\{" + keys[i] + "\\}", "gi"), args[keys[i]]);
          }
          return str;
      }
docs: helper function to format a string