define(["dist/local_object"],  function(LocalObject){
    function Pipeline(id, finalNode, resetPage, overwrite){
        this.id = id;
        this.finalNode = finalNode;
        this.resetPage = resetPage;
        this.indexObj = new LocalObject(this.id, overwrite);
    }
    Pipeline.prototype.nodes = [];
    Pipeline.prototype.add = function(runFn){
        var that = this;
        this.nodes.push(function(){
            runFn(function(){that.runNext()});
        });
    };

    Pipeline.prototype.start = function(){
        var that = this;
        if(this.indexObj.get("index") === undefined){
            this.run(0);
        } else {
            this.resetPage(function(reset){
                if(reset){
                    that.run(0);
                } else {
                    that.run(that.indexObj.get("index"));
                }
            });
        }
    };

    Pipeline.prototype.runNext = function(){
        var index = this.indexObj.get("index") + 1;
        this.run(index);
    };

    Pipeline.prototype.run = function(index){
        this.indexObj.set("index", index); 
        var node = this.nodes[index];
        if(node){
            node();
        } else {
            this.finalNode();
            this.indexObj = new LocalObject(this.id, true);
        }
    }
    console.log("pipeline", Pipeline);
    return Pipeline;
});

@@ -633,32 +633,167 @@
        %7D else %7B%0A
+            var index = that.indexObj.get(%22index%22);%0A            if(index === 0)%7B%0A                this.run(0);%0A            %7D else %7B%0A    
             this
@@ -812,32 +812,36 @@
 unction(reset)%7B%0A
+    
                 
@@ -863,32 +863,36 @@
                 
+    
 that.run(0);%0A   
@@ -896,32 +896,36 @@
                 
+   
+ 
 %7D else %7B%0A       
@@ -929,32 +929,36 @@
                 
+    
 that.run(that.in
@@ -954,37 +954,20 @@
 run(
-that.indexObj.get(%22
 index
-%22)
 );%0A
+    
     
@@ -988,27 +988,45 @@
             
-%7D);
+    %7D);%0A            %7D
 %0A        %7D%0A 

Allow quit on first page without reset prompt