code: function(chain) {
      for (var i = 0; i < chain.length; i++) {
        var line = chain[i];
        if (line.from) line.from.historyAfter = line;
        else this.first = line;
        if (line.to) line.to.historyBefore = line;
        else this.last = line;
      }
    }
docs: Link a chain into the DOM nodes (or the first/last links for null nodes).