docs: function clone(orig) {
      var copy;
      switch(typeof(orig)) {
          case 'object':
              copy = (orig.length) ? [] : {};
              for (var attr in orig) {
                  copy[attr] = clone(orig[attr]);
              }
              break;
          default:
              copy = orig;
              break;
      }
      return copy;
  }