var store = {};

function storeKeyValue (key, value) {
    store[key] = value;
}

function replaceHandlebars (string) {
    for (key in store) {
        string = string.replace(new RegExp('{{' + key + '}}','g'), store[key]);
    }
    return string;
}

//Replace any Handlebars {{key}} expression in params of a task by the value
function parseTask (task) {
    //This RegExp detects any Handlebars expression {{value}} in a string
    //It is used to determine if a param has Handlbars that need to be replaced
    var handlebarRegex = new RegExp('{{([^{}]+)}}', 'g');
    for (param in task.params) {
        var paramValue = task.params[param];
        if (handlebarRegex.test(paramValue)) {
            task.params[param] = replaceHandlebars(paramValue);
        }
    }
    return task;
}

module.exports = {
    parse: parseTask,
    store: storeKeyValue
};

@@ -563,16 +563,97 @@
 , 'g');%0A
+    var loop = function (text) %7B%0A        if (typeof text === 'object') %7B%0A        
     for 
@@ -657,28 +657,21 @@
 or (
-param
+var i
  in t
-ask.params
+ext
 ) %7B%0A
@@ -682,45 +682,76 @@
     
-var paramValue = task.params%5Bparam%5D;%0A
+        text%5Bi%5D = loop(text%5Bi%5D);%0A            %7D%0A        %7D else %7B%0A    
     
@@ -778,26 +778,20 @@
 ex.test(
-paramValue
+text
 )) %7B%0A   
@@ -803,26 +803,16 @@
     
-task.params%5Bparam%5D
+    text
  = r
@@ -832,18 +832,12 @@
 ars(
-paramValue
+text
 );%0A 
@@ -847,15 +847,88 @@
     
-%7D%0A
     %7D
+%0A        %7D%0A        return text;%0A    %7D;%0A    task.params = loop(task.params);
 %0A   

allow templating of values in deep-objects too