code: function serializeRefs(k,v, clientData) {
    if (k == 'clientTemplates') {  //avoid circular refs but doesn't seem to work??
      return undefined;
    }
    if (v && typeof v === 'object') {
      //we have to do it like this to avoid toString being call internally
      var copy = new v.constructor();
      for (var prop in v) {
        if (!v.hasOwnProperty(prop)) continue;
        var val = v[prop]
        if (val && val._id) {
          var obj = val;
          clientData[obj._id] = _.extend(clientData[obj._id] || {}, obj);
          val = "@@@" + obj._id+ "@@@";
        }
        copy[prop] = val;
      }
      return copy;
    }
    return v;
  }
docs: /*
  If an object looks like a database obj, add it to clientData and serialize it out
  as a string that would eval on the client as reference an object in the dbCache.