code: function renderClientside(_ctx, opt) {
    var out = '<script>if (window.$ && !$.templates) $.templates = {}</script>';
    if (_ctx.clientTemplates) {
      var templates = {};
      ///jscript/templatename.html => $.templates['templatename'] = function() {}
      _.each(_ctx.clientTemplates, function(value) {
        if (!templates[value.template]) {
          var scriptpath = value.template;
          var ext = path.extname(scriptpath);
          if (ext.length)
            scriptpath = scriptpath.slice(0, -1*ext.length);
          out += "<script async defer src='/jswig/" + normalizePath(scriptpath) +".js'></script>\n";
          templates[value.template] = true;
        }
      });
      out += '<script src="' + path.join( (opt && opt.jsbase) || "/js/", "swig.min.js") + '"></script>\n';
  
      var clientData = {};
      var modelJson = JSON.stringify(_ctx.clientTemplates,
        function(k,v) {return serializeRefs(k,v,clientData)}).replace(/"@@@(.+?)@@@"/g, "\$.dbCache['$1']");
      out += "\n<script>$.dbCache=" + JSON.stringify(clientData) + ';\n';
      out += "$(document).ready(function() {$.each(" + modelJson
      +", function(domid, model) {\n"
      +"     $('#'+domid).data('_template', model.template);\n"
      +"     $('#'+domid).data('_model', model.model);});\n"
      +"});</script>\n";
      //XXX should be a generic way to introspect _ctx for variables intended for client and to render them
      if (_ctx.routes && _ctx.routes.getUrlMapSource) { //XXX dbRender() needs to add routes to template locals
        out += "\n<script>$.routes=" + _ctx.routes.getUrlMapSource() + '</script>\n';
      }
   }
    return out;
  }
docs: dictionary of persistent objects model objects have references to the values in that dictionary dom elements are associated with the template and model via jquery's data()