var Replayer = function(obj) {
    this.record = [];
    var self = this;
	for (var k in obj) {
		if (typeof obj[k] === 'function') {
            // Close on k.
            (function () {
                var fnName = k;
                self[fnName] = function() {
                    var args = Array.prototype.slice.call(arguments);
                    self.record.push([ fnName, args ]);
                    var result = obj[fnName].call(obj, args);
                    console.log('Recording ' + fnName + ': result = ' + JSON.stringify(result));
                    return result === obj ? self : result;
                };
            })();
		}
	}
};

Replayer.prototype.replay = function(newSelf) {
    var results = [];
    for (var idx in this.record) {
        var curMethod = this.record[idx][0];
        var curArgs = this.record[idx][1];
        var curResult = newSelf[curMethod].call(newSelf, curArgs);
        console.log('Replaying ' + curMethod + ': result = ' + JSON.stringify(curResult));
        results.push(curResult);
    }

    return results;
};

module.exports.watch = function(obj) { return new Replayer(obj); };

@@ -67,17 +67,20 @@
 = this;%0A
-%09
+    
 for (var
@@ -92,18 +92,24 @@
  obj) %7B%0A
-%09%09
+        
 if (type
@@ -412,24 +412,100 @@
         var 
+result;%0A                    if (args.length == 1) %7B%0A                        
 result = obj
@@ -527,16 +527,19 @@
 bj, args
+%5B0%5D
 );%0A     
@@ -557,84 +557,101 @@
     
-console.log('Recording ' + fnName + ': result = ' + JSON.stringify(result));
+%7D else %7B%0A                        result = obj%5BfnName%5D.call(obj, args); %0A                    %7D
 %0A   
@@ -747,13 +747,22 @@
 ();%0A
-%09%09%7D%0A%09
+        %7D%0A    
 %7D%0A%7D;
@@ -968,16 +968,74 @@
     var 
+curResult;%0A        if (curArgs.length == 1) %7B%0A            
 curResul
@@ -1078,16 +1078,19 @@
  curArgs
+%5B0%5D
 );%0A     
@@ -1096,90 +1096,94 @@
     
-console.log('Replaying ' + curMethod + ': result = ' + JSON.stringify(curResult));
+%7D else %7B%0A            curResult = newSelf%5BcurMethod%5D.call(newSelf, curArgs); %0A        %7D
 %0A   

Fix single-argument invocations that were parsing as arrays spuriously.