define([
    '/bower_components/chainpad/chainpad.dist.js',
], function (ChainPad) {
    var Diff = ChainPad.Diff;

    var isSpace = function (S, i) {
        return /^\s$/.test(S.charAt(i));
    };

    var leadingBoundary = function (S, offset) {
        if (/\s/.test(S.charAt(offset))) { return offset; }
        while (offset > 0) {
            offset--;
            if (isSpace(S, offset)) { offset++; break; }
        }
        return offset;
    };

    var trailingBoundary = function (S, offset) {
        if (isSpace(S, offset)) { return offset; }
        while (offset < S.length && !/\s/.test(S.charAt(offset))) {
            offset++;
        }
        return offset;
    };

    var opsToWords = function (last, current) {
        var output = [];
        Diff.diff(A, B).forEach(function (op) {
            // ignore deleted sections...
            var offset = op.offset;
            var toInsert = op.toInsert;

            // given an operation,  check whether it is a word fragment,
            // if it is, expand it to its word boundaries
            var first = B.slice(leadingBoundary(B, offset), offset);
            var last = B.slice(offset + toInsert.length, trailingBoundary(B, offset + toInsert.length));

            var result = first + toInsert + last;
            // concat-in-place
            Array.prototype.push.apply(output, result.split(/\s+/));
        });
        return output;
    };

    var runningDiff = function (getter, f, time) {
        var last = getter();
        // first time through, send all the words :D
        f(opsToWords("", last));
        return setInterval(function () {
            var current = getter();

            // find inserted words...
            var words = opsToWords(last, current);
            last = current;
            f(words);
        }, time);
    };

    return runningDiff;
});

@@ -715,20 +715,24 @@
 nction (
-last
+previous
 , curren
@@ -783,12 +783,25 @@
 iff(
-A, B
+previous, current
 ).fo
@@ -1092,25 +1092,31 @@
 var first = 
-B
+current
 .slice(leadi
@@ -1118,33 +1118,39 @@
 leadingBoundary(
-B
+current
 , offset), offse
@@ -1176,17 +1176,23 @@
  last = 
-B
+current
 .slice(o
@@ -1233,17 +1233,23 @@
 oundary(
-B
+current
 , offset
@@ -1433,16 +1433,16 @@
     %7D);%0A
-
         
@@ -1454,16 +1454,32 @@
 n output
+.filter(Boolean)
 ;%0A    %7D;

make things actually work