code: function SumFunction(win) {
    var self = this, s;
    self.name = "sum";
    self.type = "simple";
    self.init = function() { s = 0; };
    self.accumulate = function(v) { s += v; };
    self.compensate = function(v) { s -= v; };
    self.emit = function()  { return s; };
    self.make = function(win) { return new SumFunction(win); };
  }
docs: Sum all the things