Add ASF License headers to all source files. Fix other scan errors. (#33)

diff --git a/README.md b/README.md
index 77b9ce9..030d42f 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
 # wskdb: The OpenWhisk Debugger
 
+[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
+<!-- #[![Build Status](https://travis-ci.org/apache/incubator-openwhisk-debugger.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-debugger) -->
+
 For documenation on the client, consult [here](client/README.md).
 
 ## ** Disclaimer **
diff --git a/broker/app.js b/broker/app.js
index 4e0566c..8f2d326 100644
--- a/broker/app.js
+++ b/broker/app.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,8 +33,8 @@
     app.get('/ping', function(req, res) { res.send("OK") });
     app.post('/invoke/begin', invoker.invoke);
     app.get('/invoke/status/:activationId', invoker.status);
-    
+
     app.listen(port, function() {
-	console.log("OWDBG Broker Ready");
+    console.log("OWDBG Broker Ready");
     });
 });
diff --git a/broker/lib/db.js b/broker/lib/db.js
index 35dd8fe..66c7268 100644
--- a/broker/lib/db.js
+++ b/broker/lib/db.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,7 +25,7 @@
 
 try {
     cloudantCreds = VCAP_SERVICES.cloudantNoSQLDB.filter(function(env) {
-	return env.name == instanceName;
+    return env.name == instanceName;
     })[0].credentials;
     cloudant = Cloudant(cloudantCreds.url);
 } catch (e) {
@@ -38,9 +39,9 @@
     console.log("Listening on port " + serverInstance.port);
 
     serverInstance.on('connection', function connection(ws) {
-	ws.on('message', function _onMessage(message) {
-	    onMessage(message, ws, docRev);
-	});
+    ws.on('message', function _onMessage(message) {
+        onMessage(message, ws, docRev);
+    });
     });
 }*/
 
@@ -56,17 +57,17 @@
 /*    var db = cloudant.db.use(dbName);
 
     db.insert({}, key, function(err, body, header) {
-	if (err) {
-	    // TODO log the error
-	    console.log("Error inserting registration into DB " + e);
-	    nextOnErr();
-	} else {
-	    next(body.rev);
-	}
-	});*/
+    if (err) {
+        // TODO log the error
+        console.log("Error inserting registration into DB " + e);
+        nextOnErr();
+    } else {
+        next(body.rev);
+    }
+    });*/
     db[key] = {
-	ws: ws,
-	activations: {}
+    ws: ws,
+    activations: {}
     }
     next();
 }
@@ -74,25 +75,25 @@
 /*    var db = cloudant.db.use(dbName);
 
     db.get(key, function(err, body, header) {
-	if (err) {
-	    nextOnErr();
-	} else {
-	    db.destroy(key, body.rev, function(err, body, header) {
-		if (err) {
-		    // TODO log the error
-		    console.log("Error inserting registration into DB " + e);
-		    nextOnErr();
-		} else {
-		    next();
-		}
-	    });
-	}
-	});*/
+    if (err) {
+        nextOnErr();
+    } else {
+        db.destroy(key, body.rev, function(err, body, header) {
+        if (err) {
+            // TODO log the error
+            console.log("Error inserting registration into DB " + e);
+            nextOnErr();
+        } else {
+            next();
+        }
+        });
+    }
+    });*/
     console.log('UNREGISTER ' + key + ' ' + activationId);
     var client = db[key];
     if (client) {
-	console.log('UNREGISTER:GotClient ' + JSON.stringify(client.activations));
-	delete db[key];
+    console.log('UNREGISTER:GotClient ' + JSON.stringify(client.activations));
+    delete db[key];
     }
 }
 
@@ -100,12 +101,12 @@
     console.log('ENDACTIVATION ' + key + ' ' + activationId);
     var client = db[key];
     if (client) {
-	console.log('ENDACTIVATION:GotClient ' + JSON.stringify(client.activations));
-	var activation = client.activations[activationId];
-	if (activation) {
-	    console.log('ENDACTIVATION:GotActivation => ' + result);
-	    activation.result = result;
-	}
+    console.log('ENDACTIVATION:GotClient ' + JSON.stringify(client.activations));
+    var activation = client.activations[activationId];
+    if (activation) {
+        console.log('ENDACTIVATION:GotActivation => ' + result);
+        activation.result = result;
+    }
     }
 }
 
@@ -126,26 +127,26 @@
     var _oops = oops.bind(undefined, ws);
 
     return function onMessage(message) {
-	console.log('MESSAGE');
-	try {
-	    message = JSON.parse(message);
-	    console.log('MESSAGE:TYPE ' + message.type + " " + JSON.stringify(message, undefined, 4));
-	    switch (message.type) {
-	    case 'init':
-		registerDebugClient(message.key, ws, _ok, _oops);
-		break;
-		
-	    case 'end':
-		endActivation(message.key, message.activationId, message.result, _ok, _oops);
-		break;
+    console.log('MESSAGE');
+    try {
+        message = JSON.parse(message);
+        console.log('MESSAGE:TYPE ' + message.type + " " + JSON.stringify(message, undefined, 4));
+        switch (message.type) {
+        case 'init':
+        registerDebugClient(message.key, ws, _ok, _oops);
+        break;
 
-	    case 'disconnect':
-		unregisterDebugClient(message.key, _ok, _oops);
-		break;
-	    }
-	} catch (e) {
-	    console.log('WS:handleCLientMessage:Error ' + JSON.stringify(e));
-	}
+        case 'end':
+        endActivation(message.key, message.activationId, message.result, _ok, _oops);
+        break;
+
+        case 'disconnect':
+        unregisterDebugClient(message.key, _ok, _oops);
+        break;
+        }
+    } catch (e) {
+        console.log('WS:handleCLientMessage:Error ' + JSON.stringify(e));
+    }
     };
 }
 
diff --git a/broker/lib/invoker.js b/broker/lib/invoker.js
index 27c750c..41f392a 100644
--- a/broker/lib/invoker.js
+++ b/broker/lib/invoker.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,59 +30,59 @@
 
     var client = getClient(key);
     if (client) {
-	//
-	// fetch the action details from the openwhisk server
-	//
-	request({
-	    url: "https://openwhisk.ng.bluemix.net/api/v1"
-		+ "/namespaces/" + encodeURIComponent(namespace)
-		+ "/actions/" + encodeURIComponent(action),
-	    method: "GET",
-	    headers: {
-		"Authorization": 'basic ' + new Buffer(key).toString('base64')
-	    }
-	}, function(err, response, body) {
-	    if (err || response.statusCode != 200) {
-		if (err) console.log("INVOKE:ErrorFetchingAction " + JSON.stringify(err));
-		else console.log("INVOKE:ErrorFetchingAction_b " + JSON.stringify(response) + " " + JSON.stringify(body));		
-		res.status(response.statusCode || 500).send(body);
-	    } else {
-		var activationId = uuid.v4();
+    //
+    // fetch the action details from the openwhisk server
+    //
+    request({
+        url: "https://openwhisk.ng.bluemix.net/api/v1"
+        + "/namespaces/" + encodeURIComponent(namespace)
+        + "/actions/" + encodeURIComponent(action),
+        method: "GET",
+        headers: {
+        "Authorization": 'basic ' + new Buffer(key).toString('base64')
+        }
+    }, function(err, response, body) {
+        if (err || response.statusCode != 200) {
+        if (err) console.log("INVOKE:ErrorFetchingAction " + JSON.stringify(err));
+        else console.log("INVOKE:ErrorFetchingAction_b " + JSON.stringify(response) + " " + JSON.stringify(body));
+        res.status(response.statusCode || 500).send(body);
+        } else {
+        var activationId = uuid.v4();
 
-		//
-		// send the action details to the debug client
-		//
-		client.ws.send(JSON.stringify({
-		    type: "invoke",
-		    key: key,
-		    activationId: activationId,
-		    onDone_trigger: req.body.onDone_trigger,
-		    actualParameters: req.body.actualParameters,
-		    action: JSON.parse(body)
-		}), function onError(error) {
-		    console.log("INVOKE:ErrorSendingToClient " + JSON.stringify(error) + " " + client.ws.readyState);
-		});
+        //
+        // send the action details to the debug client
+        //
+        client.ws.send(JSON.stringify({
+            type: "invoke",
+            key: key,
+            activationId: activationId,
+            onDone_trigger: req.body.onDone_trigger,
+            actualParameters: req.body.actualParameters,
+            action: JSON.parse(body)
+        }), function onError(error) {
+            console.log("INVOKE:ErrorSendingToClient " + JSON.stringify(error) + " " + client.ws.readyState);
+        });
 
-		//
-		// create an activation record for this invocation
-		//
-		client.activations[activationId] = activations[activationId] = {
-		    result: undefined,
-		    action: JSON.parse(body)
-		};
+        //
+        // create an activation record for this invocation
+        //
+        client.activations[activationId] = activations[activationId] = {
+            result: undefined,
+            action: JSON.parse(body)
+        };
 
-		//
-		// respond to the invoke dispatcher that all is well
-		//
-		res.status(200).send({
-		    activationId: activationId
-		});
-	    }
-	});
-	
+        //
+        // respond to the invoke dispatcher that all is well
+        //
+        res.status(200).send({
+            activationId: activationId
+        });
+        }
+    });
+
     } else {
-	console.log("INVOKE:ClientNotFound");
-	res.sendStatus(404);
+    console.log("INVOKE:ClientNotFound");
+    res.sendStatus(404);
     }
 }
 
@@ -93,12 +94,12 @@
 
     var activation = activations[activationId];
     if (activation) {
-	console.log("INVOKE:Status:Result " + JSON.stringify(activation.result));
-	res.status(200).send(JSON.stringify({
-	    result: activation.result
-	}));
+    console.log("INVOKE:Status:Result " + JSON.stringify(activation.result));
+    res.status(200).send(JSON.stringify({
+        result: activation.result
+    }));
     } else {
-	nope(res, "Could not find activationId for this debug client " + activationId);
+    nope(res, "Could not find activationId for this debug client " + activationId);
     }
 }
 
diff --git a/client/README.md b/client/README.md
index dab1d6e..b42bffe 100644
--- a/client/README.md
+++ b/client/README.md
@@ -12,7 +12,7 @@
 
 ![Startup](/client/docs/startup.png)
 
-You will now be in the `wsdk` REPL. Issue `help` to see the list of available commands. 
+You will now be in the `wsdk` REPL. Issue `help` to see the list of available commands.
 
 Note: the first time you launch `wskdb`, you will experience a ~60 second delay, as the debugger finishes up the installation. This includes pulling in the package dependencies supported by OpenWhisk. These dependencies will allow you to debug actions that require one or more of the [packages supported by OpenWhisk](https://dev-console.stage1.ng.bluemix.net/docs/openwhisk/openwhisk_reference.html#openwhisk_ref_javascript). If you have already initialized the debugger, you can always choose to reinitialize it via `wskdb --reset`; this will reinstall the dependencies.
 
@@ -62,7 +62,7 @@
    Creating sequence splice seq
 ```
 
-The short-hand for this is `-a`. 
+The short-hand for this is `-a`.
 
 ## Modifying Code
 
@@ -81,11 +81,11 @@
 (wskdb) attach -h
 Usage: attach [options]
 
-	--help, -h
-		Displays help information about this script
+    --help, -h
+        Displays help information about this script
 
-	--all, -a
-		Instrument the action, plus any rules or sequences in which it takes part
+    --all, -a
+        Instrument the action, plus any rules or sequences in which it takes part
 ```
 
 ## Choosing CLI versus Browser-based Debugging
@@ -108,13 +108,13 @@
 
 ### NodeJS
 
-In this example, I will use the debugger to inpsect and modify a NodeJS action that prints out a simple hello message. To start debugging a NodeJS action, attach it to the debugger and then invoke. 
+In this example, I will use the debugger to inpsect and modify a NodeJS action that prints out a simple hello message. To start debugging a NodeJS action, attach it to the debugger and then invoke.
 
 <img src="/client/docs/nodejs/node-invokeAction.png" width="600px"/>
 
-As shown in this screenshot, the action takes two parameters: name and place. Their initial values are "Kerry" and "Pittsburgh". 
+As shown in this screenshot, the action takes two parameters: name and place. Their initial values are "Kerry" and "Pittsburgh".
 
-The debugger will be opened in a browser window. It will first pause at a welcome message. Currently, there are three things the user can do in the dubugger UI. First, the user can change the action's source code by clicking on the code and editing it. Note that currently the user can only edit the code before the debugger entering the main action function. In this example, I change the code to say "hi" instead of "hello". I then save the change and press the "go" button to enter the main function. The second thing the user can do with the debugger is to inspect parameters and change their values using the "Local" tab in the right panel. Here I change the value of the place parameter to "New York". Lastly, the user can set up new breakpoints by clicking on the line number. Here I set a breakpoint at the return statement (line 5). See the recording below for a demo. When the action finishes running, a message will appear to tell the user to return to the CLI to view the result. 
+The debugger will be opened in a browser window. It will first pause at a welcome message. Currently, there are three things the user can do in the dubugger UI. First, the user can change the action's source code by clicking on the code and editing it. Note that currently the user can only edit the code before the debugger entering the main action function. In this example, I change the code to say "hi" instead of "hello". I then save the change and press the "go" button to enter the main function. The second thing the user can do with the debugger is to inspect parameters and change their values using the "Local" tab in the right panel. Here I change the value of the place parameter to "New York". Lastly, the user can set up new breakpoints by clicking on the line number. Here I set a breakpoint at the return statement (line 5). See the recording below for a demo. When the action finishes running, a message will appear to tell the user to return to the CLI to view the result.
 
 <img src="docs/nodejs/node-debug.gif" width="600px"/>
 
@@ -122,7 +122,7 @@
 
 <img src="/client/docs/nodejs/node-result.png" width="600px"/>
 
-With the diff command, the user can use the debugger to compare the new and old version of the code. Once satisifed, the user can publish the changes to the cloud to make it live using the publish command. 
+With the diff command, the user can use the debugger to compare the new and old version of the code. Once satisifed, the user can publish the changes to the cloud to make it live using the publish command.
 
 <img src="/client/docs/nodejs/node-diffPublish.png" width="600px"/>
 
diff --git a/client/lib/activations.js b/client/lib/activations.js
index c75feae..d3e1cc3 100644
--- a/client/lib/activations.js
+++ b/client/lib/activations.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,82 +20,80 @@
     ok_ = require('./repl-messages').ok_,
     errorWhile = require('./repl-messages').errorWhile,
     api = {
-	host: 'https://openwhisk.ng.bluemix.net',
-	path: '/api/v1'
+    host: 'https://openwhisk.ng.bluemix.net',
+    path: '/api/v1'
     };
 
 /**
  * Wait for activation completion
- *
  */
 exports.waitForActivationCompletion = function waitForActivationCompletion(wskprops, eventBus, waitForThisAction, options) {
     var key = wskprops.AUTH;
     var ow = openwhisk({
-	api: api.host + api.path,
-	api_key: key
+    api: api.host + api.path,
+    api_key: key
     });
 
     return new Promise((resolve, reject) => {
-	//
-	// this is the poll function
-	//
-	var pollOnce = function(since) {
-	    //
-	    // scan the recent activations, looking for the
-	    // anticipated activation by invoked-entity name
-	    //
-	    ow.activations.list({ limit: 1, name: waitForThisAction, since: since, docs: true }).then(list => {
-		var allDone = false;
-		for (var i = 0; i < list.length; i++) {
-		    var activationDetails = list[i];
+    //
+    // this is the poll function
+    //
+    var pollOnce = function(since) {
+        //
+        // scan the recent activations, looking for the
+        // anticipated activation by invoked-entity name
+        //
+        ow.activations.list({ limit: 1, name: waitForThisAction, since: since, docs: true }).then(list => {
+        var allDone = false;
+        for (var i = 0; i < list.length; i++) {
+            var activationDetails = list[i];
 
-		    if (options && options.result) {
-			activationDetails = activationDetails.response.result;
-		    }
-				
-		    // print out the activation record
-		    console.log(JSON.stringify(activationDetails, undefined, 4));
+            if (options && options.result) {
+            activationDetails = activationDetails.response.result;
+            }
 
-		    // let other async listeners know about it
-		    eventBus.emit('invocation-done', activationDetails);
+            // print out the activation record
+            console.log(JSON.stringify(activationDetails, undefined, 4));
 
-		    // and let the promise know about it
-		    resolve(activationDetails);
+            // let other async listeners know about it
+            eventBus.emit('invocation-done', activationDetails);
 
-		    allDone = true;
-		    break;
-		}
-		
-		if (!allDone) {
-		    //
-		    // not yet, try again in a little bit
-		    //
-		    setTimeout(() => pollOnce(since), pollIntervalMillis);
-		}
-		    
-	    }).catch(errorWhile('listing activations', reject));
-	};
+            // and let the promise know about it
+            resolve(activationDetails);
 
-	var since = options.since || Date.now();
-	setTimeout(() => pollOnce(since), pollIntervalMillis);
+            allDone = true;
+            break;
+        }
+
+        if (!allDone) {
+            //
+            // not yet, try again in a little bit
+            //
+            setTimeout(() => pollOnce(since), pollIntervalMillis);
+        }
+
+        }).catch(errorWhile('listing activations', reject));
+    };
+
+    var since = options.since || Date.now();
+    setTimeout(() => pollOnce(since), pollIntervalMillis);
     });
 };
 
 exports.mostRecentEnd = wskprops => {
     return new Promise((resolve, reject) => {
-	var key = wskprops.AUTH;
-	var ow = openwhisk({
-	    api: api.host + api.path,
-	    api_key: key,
-	    namespace: '_' // special here, as activations are currently stored in the user's default namespace
-	});
+    var key = wskprops.AUTH;
+    var ow = openwhisk({
+        api: api.host + api.path,
+        api_key: key,
+        namespace: '_' // special here, as activations are currently stored in the user's default namespace
+    });
 
-	ow.activations.list({ limit: 1, docs: true }).then(lastOne => {
-	    //
-	    // if no activations were found, then use "now"
-	    //
-	    resolve(lastOne[0].end || Date.now());
-	}).catch(reject);
+    ow.activations.list({ limit: 1, docs: true }).then(lastOne => {
+        //
+        // if no activations were found, then use "now"
+        //
+        resolve(lastOne[0].end || Date.now());
+    }).catch(reject);
     });
 };
-   
diff --git a/client/lib/commands/create-rule.js b/client/lib/commands/create-rule.js
index 4708555..9084b79 100644
--- a/client/lib/commands/create-rule.js
+++ b/client/lib/commands/create-rule.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,7 +25,6 @@
 
 /**
  * Create an action
- *
  */
 exports.create = function create() {
     var wskprops = arguments[0];
@@ -35,24 +35,24 @@
 
     var questions = [];
     if (!name) {
-	questions.push({ name: 'name', message: 'Choose a name for your new rule' });
+    questions.push({ name: 'name', message: 'Choose a name for your new rule' });
     }
     if (!trigger) {
-	questions.push({ name: 'name', message: 'Choose a trigger' });
+    questions.push({ name: 'name', message: 'Choose a trigger' });
     }
     if (!action) {
-	questions.push({ name: 'name', message: 'Choose an action' });
+    questions.push({ name: 'name', message: 'Choose an action' });
     }
 
     inquirer
-	.prompt(questions)
-	.then(response => {
-	      return setupOpenWhisk(wskprops).rules.update({
-		  name: name || response.name,
-		  trigger: `/_/${trigger || response.trigger}`,
-		  action: `/_/${action || response.action}`
-	      });
-	})
-	.then(rule => exports.created[rule.name] = true)
-	.then(ok(next), errorWhile('creating rule', next));
+    .prompt(questions)
+    .then(response => {
+          return setupOpenWhisk(wskprops).rules.update({
+          name: name || response.name,
+          trigger: `/_/${trigger || response.trigger}`,
+          action: `/_/${action || response.action}`
+          });
+    })
+    .then(rule => exports.created[rule.name] = true)
+    .then(ok(next), errorWhile('creating rule', next));
 };
diff --git a/client/lib/commands/create-trigger.js b/client/lib/commands/create-trigger.js
index c3db751..81c9c5f 100644
--- a/client/lib/commands/create-trigger.js
+++ b/client/lib/commands/create-trigger.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,7 +25,6 @@
 
 /**
  * Create an action
- *
  */
 exports.create = function create() {
     var wskprops = arguments[0];
@@ -33,16 +33,16 @@
 
     var questions = [];
     if (!name) {
-	questions.push({ name: 'name', message: 'Choose a name for your new trigger' });
+    questions.push({ name: 'name', message: 'Choose a name for your new trigger' });
     }
 
     inquirer
-	.prompt(questions)
-	.then(response => {
-	      return setupOpenWhisk(wskprops).triggers.update({
-		  name: name || response.name
-	      });
-	})
-	.then(trigger => exports.created[trigger.name] = true)
-	.then(ok(next), errorWhile('creating trigger', next));
+    .prompt(questions)
+    .then(response => {
+          return setupOpenWhisk(wskprops).triggers.update({
+          name: name || response.name
+          });
+    })
+    .then(trigger => exports.created[trigger.name] = true)
+    .then(ok(next), errorWhile('creating trigger', next));
 };
diff --git a/client/lib/commands/create.js b/client/lib/commands/create.js
index b6e86a7..67c59eb 100644
--- a/client/lib/commands/create.js
+++ b/client/lib/commands/create.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,7 +25,6 @@
 
 /**
  * Create an action
- *
  */
 exports.create = function create() {
     var wskprops = arguments[0];
@@ -35,52 +35,52 @@
 
     var questions = [];
     if (!name) {
-	questions.push({ name: 'name', message: 'Choose a name for your new action' });
+    questions.push({ name: 'name', message: 'Choose a name for your new action' });
     }
     if (!kind) {
-	questions.push({ name: 'kind', type: 'list',
-			 message: 'Which runtime do you want to use?',
-			 choices: ['nodejs', 'swift', 'python' ]
-		       });
+    questions.push({ name: 'kind', type: 'list',
+             message: 'Which runtime do you want to use?',
+             choices: ['nodejs', 'swift', 'python' ]
+               });
     }
     if (arguments.length < 5) {
-	//
-	// prompt the user for the code
-	//
-	questions.push({ name: 'code', type: 'editor',
-			 message: 'Please provide the function body for your new action',
-			 default: function(response) {
-			     if (response.kind === 'nodejs') {
-				 // nodejs
-				 return 'function main(params) {\n    return { message: \'hello\' };\n}\n';
-			     } else if (response.kind === 'swift') {
-				 // swift
-				 return 'func main(args: [String:Any]) -> [String:Any] {\n      return [ "message" : "Hello world" ]\n}\n';
-			     } else {
-				 // python
-				 return 'import sys\n\ndef main(dict):\n    return { \'message\': \'Hello world\' }\n';
-			     }
-			 }
-		       });
+    //
+    // prompt the user for the code
+    //
+    questions.push({ name: 'code', type: 'editor',
+             message: 'Please provide the function body for your new action',
+             default: function(response) {
+                 if (response.kind === 'nodejs') {
+                 // nodejs
+                 return 'function main(params) {\n    return { message: \'hello\' };\n}\n';
+                 } else if (response.kind === 'swift') {
+                 // swift
+                 return 'func main(args: [String:Any]) -> [String:Any] {\n      return [ "message" : "Hello world" ]\n}\n';
+                 } else {
+                 // python
+                 return 'import sys\n\ndef main(dict):\n    return { \'message\': \'Hello world\' }\n';
+                 }
+             }
+               });
     } else {
-	code = arguments[arguments.length -1];
-	code = code.substring(code.lastIndexOf(kind) + kind.length).trim();
-	code = code.replace(/\\n/g, '\n');
+    code = arguments[arguments.length -1];
+    code = code.substring(code.lastIndexOf(kind) + kind.length).trim();
+    code = code.replace(/\\n/g, '\n');
     }
 
     inquirer
-	.prompt(questions)
-	.then(response => {
-	      return setupOpenWhisk(wskprops).actions.create({
-		  actionName: name || response.name,
-		  action: {
-		      exec: {
-			  kind: kind || response.kind,
-			  code: code || response.code
-		      }
-		  }
-	      });
-	})
-	.then((action) => exports.created[action.name] = true)
-	.then(ok(next), errorWhile('creating action', next));
+    .prompt(questions)
+    .then(response => {
+          return setupOpenWhisk(wskprops).actions.create({
+          actionName: name || response.name,
+          action: {
+              exec: {
+              kind: kind || response.kind,
+              code: code || response.code
+              }
+          }
+          });
+    })
+    .then((action) => exports.created[action.name] = true)
+    .then(ok(next), errorWhile('creating action', next));
 };
diff --git a/client/lib/commands/delete-rule.js b/client/lib/commands/delete-rule.js
index 3fe1c71..a61b262 100644
--- a/client/lib/commands/delete-rule.js
+++ b/client/lib/commands/delete-rule.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,20 +24,19 @@
 
 /**
  * Delete an action
- *
  */
 exports.delete = function deleteRule(wskprops, next, name) {
     var ow = setupOpenWhisk(wskprops);
 
     function doDelete(name) {
-	ow.rules.delete({ name: name })
-	    .then(rule => delete created[rule.name])
-	    .then(ok(next), errorWhile('deleting rule', next));
+    ow.rules.delete({ name: name })
+        .then(rule => delete created[rule.name])
+        .then(ok(next), errorWhile('deleting rule', next));
     }
-    
+
     if (!name) {
-	errorWhile('deleting rule, no name provided', next)();
+    errorWhile('deleting rule, no name provided', next)();
     } else {
-	doDelete(name);
+    doDelete(name);
     }
 };
diff --git a/client/lib/commands/delete-trigger.js b/client/lib/commands/delete-trigger.js
index 2b0a524..465e18a 100644
--- a/client/lib/commands/delete-trigger.js
+++ b/client/lib/commands/delete-trigger.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,20 +24,19 @@
 
 /**
  * Delete an action
- *
  */
 exports.delete = function deleteTrigger(wskprops, next, name) {
     var ow = setupOpenWhisk(wskprops);
 
     function doDelete(name) {
-	ow.triggers.delete({ name: name })
-	    .then(trigger => delete created[trigger.name])
-	    .then(ok(next), errorWhile('deleting trigger', next));
+    ow.triggers.delete({ name: name })
+        .then(trigger => delete created[trigger.name])
+        .then(ok(next), errorWhile('deleting trigger', next));
     }
-    
+
     if (!name) {
-	errorWhile('deleting trigger, no name provided', next)();
+    errorWhile('deleting trigger, no name provided', next)();
     } else {
-	doDelete(name);
+    doDelete(name);
     }
 };
diff --git a/client/lib/commands/delete.js b/client/lib/commands/delete.js
index b22e5ef..7bd6c74 100644
--- a/client/lib/commands/delete.js
+++ b/client/lib/commands/delete.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,27 +24,26 @@
 
 /**
  * Delete an action
- *
  */
 exports.deleteAction = function deleteAction(wskprops, next, name) {
     var ow = setupOpenWhisk(wskprops);
 
     function doDelete(name) {
-	ow.actions.delete({ actionName: name })
-	    .then((action) => delete created[action.name])
-	    .then(ok(next), errorWhile('deleting action', next));
+    ow.actions.delete({ actionName: name })
+        .then((action) => delete created[action.name])
+        .then(ok(next), errorWhile('deleting action', next));
     }
-    
+
     if (!name) {
-	_list(ow, function(L) {
-	    require('inquirer')
-		.prompt([{ name: 'name', type: 'list',
-			   message: 'Which action do you wish to delete?',
-			   choices: L.map(function(action) { return action.name; })
-			 }])
-		.then(function(response) { doDelete(response.name); });
-	});
+    _list(ow, function(L) {
+        require('inquirer')
+        .prompt([{ name: 'name', type: 'list',
+               message: 'Which action do you wish to delete?',
+               choices: L.map(function(action) { return action.name; })
+             }])
+        .then(function(response) { doDelete(response.name); });
+    });
     } else {
-	doDelete(name);
+    doDelete(name);
     }
 };
diff --git a/client/lib/commands/diff.js b/client/lib/commands/diff.js
index a5239c9..c89d49d 100644
--- a/client/lib/commands/diff.js
+++ b/client/lib/commands/diff.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,23 +24,22 @@
 
 /**
  * Create an action
- *
  */
 exports.diff = function diff(wskprops, next, name) {
     try {
-	var diff = getOutstandingDiff(name, wskprops.NAMESPACE);
-	if (!diff) {
-	    console.log('This action has no pending changes.');
-	} else {
-	    //diff.comparo.forEach(oneDiff => {
-	    //console.log(((oneDiff.added ? '+' : '-') + oneDiff.value)[oneDiff.added ? 'green' : 'red'])
-	    //});
-	    console.log(diff.comparo);
-	}
+    var diff = getOutstandingDiff(name, wskprops.NAMESPACE);
+    if (!diff) {
+        console.log('This action has no pending changes.');
+    } else {
+        //diff.comparo.forEach(oneDiff => {
+        //console.log(((oneDiff.added ? '+' : '-') + oneDiff.value)[oneDiff.added ? 'green' : 'red'])
+        //});
+        console.log(diff.comparo);
+    }
 
-	ok_(next);
+    ok_(next);
 
     } catch (err) {
-	errorWhile('fetching diff', next)(err);
+    errorWhile('fetching diff', next)(err);
     }
 };
diff --git a/client/lib/commands/fire.js b/client/lib/commands/fire.js
index 5e7a91e..0a4896b 100644
--- a/client/lib/commands/fire.js
+++ b/client/lib/commands/fire.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,29 +26,28 @@
 
 /**
  * Fires a trigger
- *
  */
 exports.fire = function fireTrigger(wskprops, next, name) {
     var ow = setupOpenWhisk(wskprops);
 
     function doFire(name) {
-	return ow.triggers.invoke(name)
-	    .then(ok(next))
-	    .catch(errorWhile('firing trigger'), next);
+    return ow.triggers.invoke(name)
+        .then(ok(next))
+        .catch(errorWhile('firing trigger'), next);
     }
-    
+
     if (!name) {
-	_list(ow, function(L) {
-	    inquirer
-		.prompt([{ name: 'triggerName', type: 'list',
-			   message: 'Which trigger do you wish to fire?',
-			   choices: L.map(trigger => trigger.name)
-			 }])
-		.then(doFire)
-		.catch(next);
-		
-	}, 'triggers');
+    _list(ow, function(L) {
+        inquirer
+        .prompt([{ name: 'triggerName', type: 'list',
+               message: 'Which trigger do you wish to fire?',
+               choices: L.map(trigger => trigger.name)
+             }])
+        .then(doFire)
+        .catch(next);
+
+    }, 'triggers');
     } else {
-	doFire({ triggerName: name });
+    doFire({ triggerName: name });
     }
 };
diff --git a/client/lib/commands/inspect.js b/client/lib/commands/inspect.js
index 9de2711..887416a 100644
--- a/client/lib/commands/inspect.js
+++ b/client/lib/commands/inspect.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,69 +29,69 @@
     var ow = setupOpenWhisk(wskprops);
 
     function doInspect(name) {
-	const attached = isDirectlyAttachedTo(name);
-	const chainAttached = isChainAttachedTo(name);
-	const chainColor = name => name[chainAttached && isDirectlyAttachedTo(name) ? 'green' : 'reset'];
+    const attached = isDirectlyAttachedTo(name);
+    const chainAttached = isChainAttachedTo(name);
+    const chainColor = name => name[chainAttached && isDirectlyAttachedTo(name) ? 'green' : 'reset'];
 
-	console.log( ('Attached = ' + (attached ? 'yes' : chainAttached ? 'yes, to one or more parts' : 'no'))
-		     [attached ? 'blue' : chainAttached ? 'blue' : 'dim'] );
+    console.log( ('Attached = ' + (attached ? 'yes' : chainAttached ? 'yes, to one or more parts' : 'no'))
+             [attached ? 'blue' : chainAttached ? 'blue' : 'dim'] );
 
-	ow.actions.get({ actionName: name })
-	    .then(details => {
-		if (details.exec && details.exec.kind === 'sequence') {
-		    //
-		    // sequence
-		    //
-		    console.log('This is an action sequence');
-		    console.log('\t' + details.exec.components
-				.map(a => chainColor(a.substring(a.lastIndexOf('/') + 1)))
-				.join(' => '));
-		    
-		} else {
-		    //
-		    // normal action
-		    //
-		    if (property !== 'inspect' && property !== 'get' && property.indexOf('inspect ') < 0 && property.indexOf('get ') < 0) {
-			console.log(details.exec[property] || details[property]);
-		    } else {
-			console.log(`This is a ${details.exec.kind.blue} action`);
-			if (details.exec.code && !details.exec.binary) {
-			    console.log('\t' + details.exec.code.replace(/\n/g, '\n\t').green);
-			} else if (details.exec.image) {
-			    console.log('\t' + details.exec.image.green);
-			}
-		    }
-		}
+    ow.actions.get({ actionName: name })
+        .then(details => {
+        if (details.exec && details.exec.kind === 'sequence') {
+            //
+            // sequence
+            //
+            console.log('This is an action sequence');
+            console.log('\t' + details.exec.components
+                .map(a => chainColor(a.substring(a.lastIndexOf('/') + 1)))
+                .join(' => '));
 
-		ok_(next);
-	    }).catch((err) => {
-		if (err.toString().indexOf('Resource already exists with this name') >= 0) {
-		    //
-		    // then the entity exists, but isn't an action. try rules, next
-		    //
-		    ow.rules.get({ ruleName: name })
-			.then(okAfter(rule => console.log('on ' + `${rule.trigger}`.magenta + ' => ' + chainColor(rule.action)), next))
-			.catch(errorWhile('inspecting entity', next));
-		} else if (err.toString().indexOf('404') >= 0) {
-		    console.error(`Error: entity ${name} does not exist`.red);
-		    next();
-		} else {
-		    console.error(err);
-		    next();
-		}
-	    });
+        } else {
+            //
+            // normal action
+            //
+            if (property !== 'inspect' && property !== 'get' && property.indexOf('inspect ') < 0 && property.indexOf('get ') < 0) {
+            console.log(details.exec[property] || details[property]);
+            } else {
+            console.log(`This is a ${details.exec.kind.blue} action`);
+            if (details.exec.code && !details.exec.binary) {
+                console.log('\t' + details.exec.code.replace(/\n/g, '\n\t').green);
+            } else if (details.exec.image) {
+                console.log('\t' + details.exec.image.green);
+            }
+            }
+        }
+
+        ok_(next);
+        }).catch((err) => {
+        if (err.toString().indexOf('Resource already exists with this name') >= 0) {
+            //
+            // then the entity exists, but isn't an action. try rules, next
+            //
+            ow.rules.get({ ruleName: name })
+            .then(okAfter(rule => console.log('on ' + `${rule.trigger}`.magenta + ' => ' + chainColor(rule.action)), next))
+            .catch(errorWhile('inspecting entity', next));
+        } else if (err.toString().indexOf('404') >= 0) {
+            console.error(`Error: entity ${name} does not exist`.red);
+            next();
+        } else {
+            console.error(err);
+            next();
+        }
+        });
     }
-    
+
     if (!name) {
-	_list(ow, function(L) {
-	    require('inquirer')
-		.prompt([{ name: 'name', type: 'list',
-			   message: 'Which action do you wish to inspect?',
-			   choices: L.map(function(action) { return action.name; })
-			 }])
-		.then(function(response) { doInspect(response.name); });
-	});
+    _list(ow, function(L) {
+        require('inquirer')
+        .prompt([{ name: 'name', type: 'list',
+               message: 'Which action do you wish to inspect?',
+               choices: L.map(function(action) { return action.name; })
+             }])
+        .then(function(response) { doInspect(response.name); });
+    });
     } else {
-	doInspect(name);
+    doInspect(name);
     }
 };
diff --git a/client/lib/commands/list.js b/client/lib/commands/list.js
index ff13b98..8b3a4c4 100644
--- a/client/lib/commands/list.js
+++ b/client/lib/commands/list.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,9 +25,9 @@
 
 exports._list = function _list(ow, callback, type) {
     ow[type || 'actions']
-	.list({ limit: 200 })
-	.then(function onList(L) { callback(L, ow); },
-	      errorWhile('fetching actions', callback));
+    .list({ limit: 200 })
+    .then(function onList(L) { callback(L, ow); },
+          errorWhile('fetching actions', callback));
 };
 
 exports.list = function list(wskprops, callback, type) {
@@ -36,25 +37,25 @@
 
 exports.listToConsole = function listToConsole(wskprops, options, next) {
     if (options.help) {
-	return next();
+    return next();
     }
 
     console.log('Available actions:'.blue);
     function print(actions) {
-	actions
-	    .filter(action => options && options.full || !Namer.isDebugArtifact(action.name))
-	    .forEach(action => {
-		var attached = isDirectlyAttachedTo(action.name);
-		var newly = created[action.name];
-		var tabbed = attached || newly;
-		
-		console.log('    ', action.name[attached ? 'red' : newly ? 'green' : 'reset']
-			    + (tabbed ? '\t\t\t\t\t' : '')
-			    + (attached ? 'attached'.red : '')
-			    + (newly ? 'new'.green : ''));
-	    });
+    actions
+        .filter(action => options && options.full || !Namer.isDebugArtifact(action.name))
+        .forEach(action => {
+        var attached = isDirectlyAttachedTo(action.name);
+        var newly = created[action.name];
+        var tabbed = attached || newly;
 
-	ok_(next);
+        console.log('    ', action.name[attached ? 'red' : newly ? 'green' : 'reset']
+                + (tabbed ? '\t\t\t\t\t' : '')
+                + (attached ? 'attached'.red : '')
+                + (newly ? 'new'.green : ''));
+        });
+
+    ok_(next);
     }
 
     exports.list(wskprops, print);
diff --git a/client/lib/commands/publish.js b/client/lib/commands/publish.js
index a4419fb..0e009ad 100644
--- a/client/lib/commands/publish.js
+++ b/client/lib/commands/publish.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,32 +26,31 @@
 
 /**
  * Create an action
- *
  */
 exports.publish = function publish(wskprops, next, name) {
     try {
-	var diff = getOutstandingDiff(name, wskprops.NAMESPACE);
-	
-	if (!diff) {
-	    console.log('This action has no pending changes.');
-	} else {
-	    var newAction = Object.assign({}, diff.action);
-	    newAction.exec.code = applyPatch(newAction.exec.code, diff.comparo);
-	    
-	    var ow = setupOpenWhisk(wskprops);
-	    ow.actions.update({
-		actionName: diff.action.name,
-		action: newAction
-	    });
-	}
+    var diff = getOutstandingDiff(name, wskprops.NAMESPACE);
 
-	clearOutstandingDiff(name, wskprops.NAMESAPCE);
-	
-	console.log('Your changes are now live');
-	ok_(next);
+    if (!diff) {
+        console.log('This action has no pending changes.');
+    } else {
+        var newAction = Object.assign({}, diff.action);
+        newAction.exec.code = applyPatch(newAction.exec.code, diff.comparo);
+
+        var ow = setupOpenWhisk(wskprops);
+        ow.actions.update({
+        actionName: diff.action.name,
+        action: newAction
+        });
+    }
+
+    clearOutstandingDiff(name, wskprops.NAMESAPCE);
+
+    console.log('Your changes are now live');
+    ok_(next);
 
     } catch (err) {
-	console.error(err.stack);
-	errorWhile('applying patch', next)(err);
+    console.error(err.stack);
+    errorWhile('applying patch', next)(err);
     }
 };
diff --git a/client/lib/debug-bootstrap.js b/client/lib/debug-bootstrap.js
index f6f9926..f7634c4 100644
--- a/client/lib/debug-bootstrap.js
+++ b/client/lib/debug-bootstrap.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,34 +17,34 @@
 
 var openwhisk = require('openwhisk'),
     api = {
-	host: 'https://openwhisk.ng.bluemix.net',
-	path: '/api/v1'
+    host: 'https://openwhisk.ng.bluemix.net',
+    path: '/api/v1'
     };
 
 module.exports = function(key, namespace, triggerName, breakAtExit) {
     return function(main, actualParameters) {
-	var result = main(actualParameters || {});
+    var result = main(actualParameters || {});
 
-	var ow = openwhisk({
-	    api: api.host + api.path,
-	    api_key: key,
-	    namespace: namespace
-	});
+    var ow = openwhisk({
+        api: api.host + api.path,
+        api_key: key,
+        namespace: namespace
+    });
 
-	// if you want to insert a breakpoint just before exit
-	if (breakAtExit) {
-	    /* jshint ignore:start */
-	    debugger;
-	    /* jshint ignore:end */
-	}
+    // if you want to insert a breakpoint just before exit
+    if (breakAtExit) {
+        /* jshint ignore:start */
+        debugger;
+        /* jshint ignore:end */
+    }
 
-	// console.log('Returning ' + JSON.stringify(result, undefined, 4));
+    // console.log('Returning ' + JSON.stringify(result, undefined, 4));
 
-	ow.triggers.invoke({
-	    triggerName: triggerName,
-	    params: result
-	}).then(function() {
-	    // console.log('Debug session complete');
-	});
+    ow.triggers.invoke({
+        triggerName: triggerName,
+        params: result
+    }).then(function() {
+        // console.log('Debug session complete');
+    });
     };
 };
diff --git a/client/lib/debug-bootstrap/python/bootstrap.py b/client/lib/debug-bootstrap/python/bootstrap.py
index 445f209..c1aab2a 100644
--- a/client/lib/debug-bootstrap/python/bootstrap.py
+++ b/client/lib/debug-bootstrap/python/bootstrap.py
@@ -1,11 +1,12 @@
 #
-# Copyright 2015-2016 IBM Corporation
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,29 +20,31 @@
 import json
 import urllib
 
+
 # returns a name escaped so it can be used in a url.
 def getSafeName(name):
     safeChars = '@:./'
     return urllib.quote(name, safeChars)
 
+
 def bootstrap(key, namespace, triggerName, main, actualParameters):
     try:
         result = main(actualParameters)
-        
+
         http = httplib2.Http()
-        
+
         url = 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/%(namespace)s/triggers/%(name)s' % {
             'namespace': urllib.quote(namespace),
             'name': getSafeName(triggerName)
         }
-        
+
         headers = {'Content-type': 'application/json' }
-        
+
         auth = base64.encodestring(key).replace('\n', '')
         headers['Authorization'] = 'Basic %s' % auth
-        
+
         payload = json.dumps(result)
-        
+
         response, content = http.request(url, 'POST', headers=headers, body=payload)
 
     except:
diff --git a/client/lib/debug-nodejs.js b/client/lib/debug-nodejs.js
index 25a664d..ee574a6 100644
--- a/client/lib/debug-nodejs.js
+++ b/client/lib/debug-nodejs.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,9 +27,9 @@
 
 exports.debug = function debugNodeJS(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
     try {
-	exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
+    exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 };
 exports._debug = function debugNodeJS(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
@@ -37,8 +38,8 @@
     var r = new RegExp(/function main[\s]*\([^\)]*\)/);
     var startOfMethodBody = code.search(r);
     if (startOfMethodBody >= 0) {
-	var paren = code.indexOf('{', startOfMethodBody);
-	code = code.substring(0, paren + 1) + '\n    // Welcome to your main method\n    debugger;\n' + code.substring(paren + 1);
+    var paren = code.indexOf('{', startOfMethodBody);
+    code = code.substring(0, paren + 1) + '\n    // Welcome to your main method\n    debugger;\n' + code.substring(paren + 1);
     }
 
 /*    var bootstrap = '\n\n\nvar result = main.apply(undefined, ' + JSON.stringify([message.actualParameters || {}]) + ');';
@@ -49,19 +50,19 @@
     bootstrap += 'ow.triggers.invoke({ triggerName: \'' + echoChamberNames.trigger + '\', params: result });\n';*/
 
     if (commandLineOptions['use-cli-debugger']) {
-	// in CLI mode, try to save space with a terse message
-	code += '\n\nconsole.log(\'Debug session initiated.\');\n';
-	code += 'console.log(\'Enter the [cont] command to start your debugging session\');\n\n';
+    // in CLI mode, try to save space with a terse message
+    code += '\n\nconsole.log(\'Debug session initiated.\');\n';
+    code += 'console.log(\'Enter the [cont] command to start your debugging session\');\n\n';
     } else {
-	// in UI mode, we have more real estate for a longer message
-	code += '\n\n\n\n\n//\n';
-	code += '// Welcome to the OpenWhisk debugger.\n';
-	code += '//\n';
-	code += '// To proceed with debugging, press the continue => button.\n';
-	code += '// The first breakpoint will be in your main method\n';
-	code += '//\n\n';
+    // in UI mode, we have more real estate for a longer message
+    code += '\n\n\n\n\n//\n';
+    code += '// Welcome to the OpenWhisk debugger.\n';
+    code += '//\n';
+    code += '// To proceed with debugging, press the continue => button.\n';
+    code += '// The first breakpoint will be in your main method\n';
+    code += '//\n\n';
     }
-    
+
     code += 'require(\'debug-bootstrap\')(\'' + message.key + '\', \'' + message.action.namespace + '\', \'' + echoChamberNames.trigger + '\')(main, ' + JSON.stringify(message.actualParameters || {}) + ');';
 
     //
@@ -69,175 +70,175 @@
     // so that we can ignore them when determining whether the user has modified the file
     //
     var removeBootstrapPatch = diff.createPatch(code, message.action.exec.code);
-    
-    tmp.dir({ prefix: 'wskdb-', unsafeCleanup: true}, function onTempDirCreation(err, tmpDirPath, tmpdirCleanupCallback) {
-	// console.log('TMP ' + tmpdirPath);
-	var tmpFilePath = path.join(tmpDirPath, message.action.name + '.js-debug');
 
-	try {
-	    fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
+    tmp.dir({ prefix: 'wskdb-', unsafeCleanup: true}, function onTempDirCreation(err, tmpDirPath, tmpdirCleanupCallback) {
+    // console.log('TMP ' + tmpdirPath);
+    var tmpFilePath = path.join(tmpDirPath, message.action.name + '.js-debug');
+
+    try {
+        fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
 
             // we need to update the NODE_PATH env var, to add our local modules
-	    var env = Object.assign({}, process.env);
-	    env.NODE_PATH = path.join(__dirname, '..', 'node_modules')
-		+ ':' + path.join(__dirname, '..', 'lib')
-		+ ':' + path.join(__dirname, '..', 'deps', 'nodejs6', 'node_modules');
+        var env = Object.assign({}, process.env);
+        env.NODE_PATH = path.join(__dirname, '..', 'node_modules')
+        + ':' + path.join(__dirname, '..', 'lib')
+        + ':' + path.join(__dirname, '..', 'deps', 'nodejs6', 'node_modules');
 
-	    function trySpawnWithBrowser(webPort, debugPort) {
-		var spawnOpts = {
-		    cwd: process.cwd(),
-		    // stdio: ['inherit', 'inherit', 'inherit'], // for debugging
-		    env: env
-		};
-		var child = spawn(path.join(__dirname, '..', 'node_modules', '.bin', 'node-debug'),
-				  ['--cli',
-				   '--debug-port', debugPort,
-				   '--web-port', webPort,
-				   '--save-live-edit',
-				   '--no-preload',
-				   '--hidden', '\.js$',
-				   tmpFilePath],
-				  spawnOpts);
-		var child2;
-		var addrInUse = false;
+        function trySpawnWithBrowser(webPort, debugPort) {
+        var spawnOpts = {
+            cwd: process.cwd(),
+            // stdio: ['inherit', 'inherit', 'inherit'], // for debugging
+            env: env
+        };
+        var child = spawn(path.join(__dirname, '..', 'node_modules', '.bin', 'node-debug'),
+                  ['--cli',
+                   '--debug-port', debugPort,
+                   '--web-port', webPort,
+                   '--save-live-edit',
+                   '--no-preload',
+                   '--hidden', '\.js$',
+                   tmpFilePath],
+                  spawnOpts);
+        var child2;
+        var addrInUse = false;
 
-		//
-		// a bit of a hack here: wait a bit to see if we get an EADDRINUSE on stderr
-		//
-		setTimeout(() => child.stdout.on('data', function(data) {
-		    if (!child2 && !addrInUse) {
-			var url = 'http://127.0.0.1:' + webPort + '/?port=' + debugPort;
-			child2 = open(url, 'Google Chrome');
+        //
+        // a bit of a hack here: wait a bit to see if we get an EADDRINUSE on stderr
+        //
+        setTimeout(() => child.stdout.on('data', function(data) {
+            if (!child2 && !addrInUse) {
+            var url = 'http://127.0.0.1:' + webPort + '/?port=' + debugPort;
+            child2 = open(url, 'Google Chrome');
 
-			/*console.log('');
-			console.log('');
-			console.log('\tVisit ' + url.underline.blue + ' in the ' + 'Chrome'.red + ' browser that just popped up');
-			console.log('\tClose that browser tab to complete your debugging session'.bold);
-			console.log('');
-			console.log('');*/
-		    }
-		}), 500);
+            /*console.log('');
+            console.log('');
+            console.log('\tVisit ' + url.underline.blue + ' in the ' + 'Chrome'.red + ' browser that just popped up');
+            console.log('\tClose that browser tab to complete your debugging session'.bold);
+            console.log('');
+            console.log('');*/
+            }
+        }), 500);
 
-		// for debugging the child invocation:
-		child.stderr.on('data', (message) => {
-		    message = message.toString();
+        // for debugging the child invocation:
+        child.stderr.on('data', (message) => {
+            message = message.toString();
 
-		    if (message.indexOf('EADDRINUSE') >= 0) {
-			//
-			// oops, we'll need to try another pair of
-			// ports. we'll do son in the on('exit')
-			// handler below
-			//
-			addrInUse = true;
-			kill(child.pid);
+            if (message.indexOf('EADDRINUSE') >= 0) {
+            //
+            // oops, we'll need to try another pair of
+            // ports. we'll do son in the on('exit')
+            // handler below
+            //
+            addrInUse = true;
+            kill(child.pid);
 
-		    } else if (message.indexOf('ResourceTree') < 0
-			       && message.indexOf('Assertion failed') < 0
-			       && message.indexOf('listening on port') < 0
-			       && message.indexOf('another process already listening') < 0
-			       && message.indexOf('exceptionWithHostPort') < 0
-			       && message.indexOf('use a different port') < 0) {
-			//
-			// ignore some internal errors in node-inspector
-			//
-			console.error('stderr: '.red + message);
-		    }
-		});
+            } else if (message.indexOf('ResourceTree') < 0
+                   && message.indexOf('Assertion failed') < 0
+                   && message.indexOf('listening on port') < 0
+                   && message.indexOf('another process already listening') < 0
+                   && message.indexOf('exceptionWithHostPort') < 0
+                   && message.indexOf('use a different port') < 0) {
+            //
+            // ignore some internal errors in node-inspector
+            //
+            console.error('stderr: '.red + message);
+            }
+        });
 
-		var onInvocationDone = function() {
-		    try {
-			child.__killedByWSKDBInvocationDone = true;
-			kill(child.pid);
-		    } catch (err) {
-			console.error('Error cleaning up after activation completion', err);
-		    }
-		};
-		
-		function cleanUpSubprocesses(err, stdout, stderr) {
-		    if (addrInUse) {
-			eventBus.removeListener('invocation-done', onInvocationDone);
-			return trySpawnWithBrowser(webPort + 1, debugPort + 1);
-		    } else if (err) {
-			console.log('Error launching debugger', err);
-		    } else {
-			diff.rememberIfChanged(message.action, tmpFilePath, tmpdirCleanupCallback, removeBootstrapPatch);
+        var onInvocationDone = function() {
+            try {
+            child.__killedByWSKDBInvocationDone = true;
+            kill(child.pid);
+            } catch (err) {
+            console.error('Error cleaning up after activation completion', err);
+            }
+        };
 
-			if (!child.__killedByWSKDBInvocationDone) {
-			    // if we were killed by an invocation-done event, then the ok was already issued elsewhere
-			    ok_(done);
-			} else {
-			    done();
-			}
-		    }
-		}
-		child.on('exit', cleanUpSubprocesses);
+        function cleanUpSubprocesses(err, stdout, stderr) {
+            if (addrInUse) {
+            eventBus.removeListener('invocation-done', onInvocationDone);
+            return trySpawnWithBrowser(webPort + 1, debugPort + 1);
+            } else if (err) {
+            console.log('Error launching debugger', err);
+            } else {
+            diff.rememberIfChanged(message.action, tmpFilePath, tmpdirCleanupCallback, removeBootstrapPatch);
 
-		//
-		// the activation that we are debugging has
-		// finished. kill the child debugger process
-		//
-		eventBus.on('invocation-done', onInvocationDone);
+            if (!child.__killedByWSKDBInvocationDone) {
+                // if we were killed by an invocation-done event, then the ok was already issued elsewhere
+                ok_(done);
+            } else {
+                done();
+            }
+            }
+        }
+        child.on('exit', cleanUpSubprocesses);
 
-	    } /* end of trySpawnWithBrowser */
+        //
+        // the activation that we are debugging has
+        // finished. kill the child debugger process
+        //
+        eventBus.on('invocation-done', onInvocationDone);
 
-	    function spawnWithCLI() {
-		try {
-		    var spawnOpts = {
-			cwd: process.cwd(),
-			stdio: ['inherit', 'inherit', 'pipe'],
-			env: env
-		    };
-		    var child = spawn('node',
-				      ['debug', tmpFilePath],
-				      spawnOpts);
+        } /* end of trySpawnWithBrowser */
 
-		    //
-		    // the activation that we are debugging has
-		    // finished. kill the child debugger process
-		    //
-		    eventBus.on('invocation-done', () => kill(child.pid));
+        function spawnWithCLI() {
+        try {
+            var spawnOpts = {
+            cwd: process.cwd(),
+            stdio: ['inherit', 'inherit', 'pipe'],
+            env: env
+            };
+            var child = spawn('node',
+                      ['debug', tmpFilePath],
+                      spawnOpts);
 
-		    var addrInUse = false;
-		    child.stderr.on('data', (message) => {
-			message = message.toString();
-			if (message.indexOf('EADDRINUSE') >= 0) {
-			    addrInUse = true;
-			    kill(child.pid);
-			}
-		    });
-				    
-		    //
-		    // the child debugger process has terminated, clean things up
-		    //
-		    child.on('exit', (code) => {
-			if (addrInUse) {
-			    console.error('Port 5858 is in use, please clear this up, thanks'.red);
-			}
-			if (code !== 0) {
-			    console.error('The NodeJS debugger exited abnormally with code ' + code);
-			}
+            //
+            // the activation that we are debugging has
+            // finished. kill the child debugger process
+            //
+            eventBus.on('invocation-done', () => kill(child.pid));
 
-			diff.rememberIfChanged(message.action, tmpFilePath, tmpdirCleanupCallback, removeBootstrapPatch);
-			done(); // we don't need to "ok" here, as the invoker will do that for us
-		    });
-		} catch (e) {
-		    console.error('Error spawning debugger', e);
-		    console.error(e.stack);
-		    done();
-		}
-	    }
+            var addrInUse = false;
+            child.stderr.on('data', (message) => {
+            message = message.toString();
+            if (message.indexOf('EADDRINUSE') >= 0) {
+                addrInUse = true;
+                kill(child.pid);
+            }
+            });
 
-	    if (commandLineOptions['use-cli-debugger'] && options['use-cli-debugger'] !== false) {
-		spawnWithCLI();
-	    } else {
-		trySpawnWithBrowser(8080, 5858);
-	    }
-	});
-	} catch (e) {
-	    console.error(e);
-	    console.error(e.stack);
-	    try { tmpdirCleanupCallback(); } catch (e) { }
-	    done();
-	}
+            //
+            // the child debugger process has terminated, clean things up
+            //
+            child.on('exit', (code) => {
+            if (addrInUse) {
+                console.error('Port 5858 is in use, please clear this up, thanks'.red);
+            }
+            if (code !== 0) {
+                console.error('The NodeJS debugger exited abnormally with code ' + code);
+            }
+
+            diff.rememberIfChanged(message.action, tmpFilePath, tmpdirCleanupCallback, removeBootstrapPatch);
+            done(); // we don't need to "ok" here, as the invoker will do that for us
+            });
+        } catch (e) {
+            console.error('Error spawning debugger', e);
+            console.error(e.stack);
+            done();
+        }
+        }
+
+        if (commandLineOptions['use-cli-debugger'] && options['use-cli-debugger'] !== false) {
+        spawnWithCLI();
+        } else {
+        trySpawnWithBrowser(8080, 5858);
+        }
+    });
+    } catch (e) {
+        console.error(e);
+        console.error(e.stack);
+        try { tmpdirCleanupCallback(); } catch (e) { }
+        done();
+    }
     });
 };
diff --git a/client/lib/debug-python.js b/client/lib/debug-python.js
index e09a14b..e1689c8 100644
--- a/client/lib/debug-python.js
+++ b/client/lib/debug-python.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,9 +27,9 @@
 
 exports.debug = function debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
     try {
-	exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
+    exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 };
 exports._debug = function debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
@@ -37,13 +38,13 @@
     var r = new RegExp(/def main[\s]*\([^\)]*\):/);
     var startOfMethodBody = code.search(r);
     if (startOfMethodBody >= 0) {
-	var colon = code.indexOf(':', startOfMethodBody);
-	code =
-	    code.substring(0, colon + 1)
-	    + '\n    # Welcome to your main method\n'
-	    + '    from pdb import set_trace as debugger\n'
-	    + '    debugger()\n'
-	    + code.substring(colon + 1);
+    var colon = code.indexOf(':', startOfMethodBody);
+    code =
+        code.substring(0, colon + 1)
+        + '\n    # Welcome to your main method\n'
+        + '    from pdb import set_trace as debugger\n'
+        + '    debugger()\n'
+        + code.substring(colon + 1);
     }
 
     code += '\n\n\nfrom bootstrap import bootstrap\n';
@@ -55,87 +56,87 @@
     code += '    sys.exit(0)\n';
 
     tmp.dir({ prefix: 'wskdb-', unsafeCleanup: true}, function onTempDirCreation(err, tmpDirPath, tmpdirCleanupCallback) {
-	var tmpdirPathRegExp = new RegExp(tmpDirPath + '/');
-	var tmpFilePath = path.join(tmpDirPath, message.action.name + '.py');
+    var tmpdirPathRegExp = new RegExp(tmpDirPath + '/');
+    var tmpFilePath = path.join(tmpDirPath, message.action.name + '.py');
 
-	try {
-	    fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
+    try {
+        fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
 
-		// we need to update the NODE_PATH env var, to add our local modules
-		var env = Object.assign({}, process.env);
-		env.PYTHONPATH = path.join(__dirname, '..', 'lib', 'debug-bootstrap', 'python');
-		env.PYTHONUNBUFFERED = '1';
+        // we need to update the NODE_PATH env var, to add our local modules
+        var env = Object.assign({}, process.env);
+        env.PYTHONPATH = path.join(__dirname, '..', 'lib', 'debug-bootstrap', 'python');
+        env.PYTHONUNBUFFERED = '1';
 
-		function spawnWithCLI() {
-		    try {
-			var spawnOpts = {
-			    cwd: process.cwd(),
-			    stdio: ['inherit', 'pipe', 'pipe'],
-			    env: env
-			};
-			var child = spawn('python',
-					  ['-u',
-					   '-m', 'pdb',
-					   tmpFilePath],
-					  spawnOpts);
-			
-			//
-			// the activation that we are debugging has
-			// finished. kill the child debugger process
-			//   SIGKILL is required to avoid killing wskdb, too
-			eventBus.on('invocation-done', () => child.kill('SIGKILL'));
-			
-			child.stderr.on('data', message => console.error(message.toString().red));
+        function spawnWithCLI() {
+            try {
+            var spawnOpts = {
+                cwd: process.cwd(),
+                stdio: ['inherit', 'pipe', 'pipe'],
+                env: env
+            };
+            var child = spawn('python',
+                      ['-u',
+                       '-m', 'pdb',
+                       tmpFilePath],
+                      spawnOpts);
 
-			var baked = false, raw = true, first = true;
-			child.stdout.on('data', function(message) {
-			    try {
-				if (raw) {
-				    raw = false;
-				    console.log();
-				    console.log('Hello from the Python debugger. Enter '
-						+ 'c'.red + ' or ' + 'continue'.red + ' to enter your main method.');
-				    console.log('Hint: enter ' + 'l'.red + ' or ' + 'list'.red + ' to see a longer program listing');
-				    console.log();
-				}
+            //
+            // the activation that we are debugging has
+            // finished. kill the child debugger process
+            //   SIGKILL is required to avoid killing wskdb, too
+            eventBus.on('invocation-done', () => child.kill('SIGKILL'));
 
-				if (!baked) {
-				    if (message.indexOf('The program exited via sys.exit') >= 0) {
-					baked = true;
-				    } else {
-					process.stdout.write(message.toString().replace(tmpdirPathRegExp, '').blue.dim);
-				    }
-				}
-			    } catch (err) {
-				console.error(err);
-			    }
-			});
-			
-			//
-			// the child debugger process has terminated, clean things up
-			//
-			child.on('exit', code => {
-			    //if (code !== 0) {
-			    //console.error('The Python debugger exited abnormally with code ' + code);
-			    //}
-			    
-			    //try { tmpdirCleanupCallback(); } catch (e) { }
-			    done(); // we don't need to "ok" here, as the invoker will do that for us
-			});
-		    } catch (e) {
-			console.error('Error spawning debugger', e);
-			console.error(e.stack);
-			done();
-		    }
-		}
-		
-		spawnWithCLI();
-	    });
-	} catch (e) {
-	    console.error(e);
-	    console.error(e.stack);
-	    //try { tmpdirCleanupCallback(); } catch (e) { }
-	    done();
-	}
+            child.stderr.on('data', message => console.error(message.toString().red));
+
+            var baked = false, raw = true, first = true;
+            child.stdout.on('data', function(message) {
+                try {
+                if (raw) {
+                    raw = false;
+                    console.log();
+                    console.log('Hello from the Python debugger. Enter '
+                        + 'c'.red + ' or ' + 'continue'.red + ' to enter your main method.');
+                    console.log('Hint: enter ' + 'l'.red + ' or ' + 'list'.red + ' to see a longer program listing');
+                    console.log();
+                }
+
+                if (!baked) {
+                    if (message.indexOf('The program exited via sys.exit') >= 0) {
+                    baked = true;
+                    } else {
+                    process.stdout.write(message.toString().replace(tmpdirPathRegExp, '').blue.dim);
+                    }
+                }
+                } catch (err) {
+                console.error(err);
+                }
+            });
+
+            //
+            // the child debugger process has terminated, clean things up
+            //
+            child.on('exit', code => {
+                //if (code !== 0) {
+                //console.error('The Python debugger exited abnormally with code ' + code);
+                //}
+
+                //try { tmpdirCleanupCallback(); } catch (e) { }
+                done(); // we don't need to "ok" here, as the invoker will do that for us
+            });
+            } catch (e) {
+            console.error('Error spawning debugger', e);
+            console.error(e.stack);
+            done();
+            }
+        }
+
+        spawnWithCLI();
+        });
+    } catch (e) {
+        console.error(e);
+        console.error(e.stack);
+        //try { tmpdirCleanupCallback(); } catch (e) { }
+        done();
+    }
     });
 };
diff --git a/client/lib/debug-swift.js b/client/lib/debug-swift.js
index e5eed2b..50e4579 100644
--- a/client/lib/debug-swift.js
+++ b/client/lib/debug-swift.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,69 +25,69 @@
 function compileIt(sourcePath, tmpDirPath, actionName) {
     // console.log("COMPILEIT", sourcePath);
     return new Promise((resolve, reject) => {
-	var spawnOpts = {
-	    cwd: tmpDirPath,
-	    stdio: ['inherit', 'inherit', 'inherit'],
-	    env: process.env
-	};
-	try {
-	    var executablePath = path.join(tmpDirPath, actionName);
-	    var child = spawn('xcrun',
-			      ['--sdk', 'macosx', 'swiftc',
-			       '-o', executablePath,
-			       '-g',
-			       sourcePath],
-			      spawnOpts);
-	    child.on('exit', (code) => {
-		if (code !== 0) {
-		    reject(code);
-		} else {
-		    resolve(executablePath);
-		}
-	    });
-	} catch (err) {
-	    console.error(err);
-	    reject(err);
-	}
+    var spawnOpts = {
+        cwd: tmpDirPath,
+        stdio: ['inherit', 'inherit', 'inherit'],
+        env: process.env
+    };
+    try {
+        var executablePath = path.join(tmpDirPath, actionName);
+        var child = spawn('xcrun',
+                  ['--sdk', 'macosx', 'swiftc',
+                   '-o', executablePath,
+                   '-g',
+                   sourcePath],
+                  spawnOpts);
+        child.on('exit', (code) => {
+        if (code !== 0) {
+            reject(code);
+        } else {
+            resolve(executablePath);
+        }
+        });
+    } catch (err) {
+        console.error(err);
+        reject(err);
+    }
     });
 }
 
 function debugIt(eventBus, executablePath) {
     // console.log("DEBUGIT", executablePath);
     return new Promise((resolve, reject) => {
-	try {
-	    var spawnOpts = {
-		cwd: process.cwd(),
-		stdio: ['inherit', 'inherit', 'inherit'],
-		env: process.env
-	    };
-	    try {
-		var child = spawn('lldb',
-				  ['-s', path.join(__dirname, '..', 'lib', 'helpers', 'lldb.run'),
-				   executablePath],
-				  spawnOpts);
-		child.on('exit', (code) => {
-		    if (code !== 0 && code !== null) {
-			console.error('The Swift debugger exited abnormally with code ' + code + ' ' + (code === 'null'));
-			reject(code);
-		    } else {
-			//executableCleanup();
-			resolve();
-		    }
-		});
-		
-		eventBus.on('invocation-done', () => child.kill());
-		
-	    } catch (e) {
-		console.error('Error spawning debugger', e);
-		console.error(e.stack);
-		reject(e);
-	    }
-	} catch (e) {
-	    console.error('Error spawning debugger', e);
-	    console.error(e.stack);
-	    reject(e);
-	}
+    try {
+        var spawnOpts = {
+        cwd: process.cwd(),
+        stdio: ['inherit', 'inherit', 'inherit'],
+        env: process.env
+        };
+        try {
+        var child = spawn('lldb',
+                  ['-s', path.join(__dirname, '..', 'lib', 'helpers', 'lldb.run'),
+                   executablePath],
+                  spawnOpts);
+        child.on('exit', (code) => {
+            if (code !== 0 && code !== null) {
+            console.error('The Swift debugger exited abnormally with code ' + code + ' ' + (code === 'null'));
+            reject(code);
+            } else {
+            //executableCleanup();
+            resolve();
+            }
+        });
+
+        eventBus.on('invocation-done', () => child.kill());
+
+        } catch (e) {
+        console.error('Error spawning debugger', e);
+        console.error(e.stack);
+        reject(e);
+        }
+    } catch (e) {
+        console.error('Error spawning debugger', e);
+        console.error(e.stack);
+        reject(e);
+    }
     });
 }
 
@@ -96,21 +97,21 @@
 */
 function jsonToSwiftDictionary(params) {
     var s = JSON.stringify(params)
-	.replace(/{/g, '[')
-	.replace(/}/g, ']');
+    .replace(/{/g, '[')
+    .replace(/}/g, ']');
 
     if (s === '[]') {
-	return '[:]';
+    return '[:]';
     } else {
-	return s;
+    return s;
     }
 }
-    
+
 exports.debug = function debugSwift(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
     try {
-	exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
+    exports._debug(message, ws, echoChamberNames, done, commandLineOptions, eventBus);
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 };
 exports._debug = function debugSwift(message, ws, echoChamberNames, done, commandLineOptions, eventBus) {
@@ -129,50 +130,50 @@
     var r = new RegExp(/func main[\s]*\([^\)]*\)/);
     var startOfMethodBody = code.search(r);
     if (startOfMethodBody >= 0) {
-	var paren = code.indexOf('{', startOfMethodBody);
-	code = code.substring(0, paren + 1) + '\n    // Hello from the OpenWhisk debugger. Welcome to your main method\n' + code.substring(paren + 1);
+    var paren = code.indexOf('{', startOfMethodBody);
+    code = code.substring(0, paren + 1) + '\n    // Hello from the OpenWhisk debugger. Welcome to your main method\n' + code.substring(paren + 1);
     }
 
     fs.readFile(path.join(__dirname, '..', 'lib', 'debug-bootstrap.swift'), (err, codeBuffer) => {
-	//
-	// inline the bootstrapping logic into the file to be debugged
-	//
-	code += codeBuffer.toString('utf8');
+    //
+    // inline the bootstrapping logic into the file to be debugged
+    //
+    code += codeBuffer.toString('utf8');
 
-	//
-	// lastly, invoke the bootstrap method
-	//
-	code += '\nvar params: [String:Any] = ' + jsonToSwiftDictionary(message.actualParameters);
-	code += '\nbootstrap(key: "' + message.key + '", namespace: "' + message.action.namespace + '", triggerName: "' + echoChamberNames.trigger + '", main: main, actualParameters: &params);';
+    //
+    // lastly, invoke the bootstrap method
+    //
+    code += '\nvar params: [String:Any] = ' + jsonToSwiftDictionary(message.actualParameters);
+    code += '\nbootstrap(key: "' + message.key + '", namespace: "' + message.action.namespace + '", triggerName: "' + echoChamberNames.trigger + '", main: main, actualParameters: &params);';
 
-	//
-	// we will store the temporary files in a temporary directory
-	//
-	tmp.dir({ prefix: 'wskdb-', unsafeCleanup: true }, function onTempDirCreation(err, tmpDirPath, fd, tmpdirCleanupCallback) {
-	    //
-	    // this is the source file path that we'll use
-	    //
-	    var tmpFilePath = path.join(tmpDirPath, message.action.name + '.swift');
+    //
+    // we will store the temporary files in a temporary directory
+    //
+    tmp.dir({ prefix: 'wskdb-', unsafeCleanup: true }, function onTempDirCreation(err, tmpDirPath, fd, tmpdirCleanupCallback) {
+        //
+        // this is the source file path that we'll use
+        //
+        var tmpFilePath = path.join(tmpDirPath, message.action.name + '.swift');
 
-	    try {
-		//
-		// write it out, compile it, then launch the debugger
-		//
-		fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
+        try {
+        //
+        // write it out, compile it, then launch the debugger
+        //
+        fs.writeFile(tmpFilePath, code, 0, 'utf8', function onFileWriteCompletion(err, written, string) {
 
-		    compileIt(tmpFilePath, tmpDirPath, message.action.name)
-			.then(debugIt.bind(undefined, eventBus))
-			.then(() => {
-			    try { tmpdirCleanupCallback(); } catch (e) { }
-			    done(); // we don't need to "ok" here, as the invoker will do that for us
-			});
-		});
-	    } catch (err) {
-		console.error(err);
-		console.error(err.stack);
-		try { tmpdirCleanupCallback(); } catch (e) { }
-		done();
-	    }
-	});
+            compileIt(tmpFilePath, tmpDirPath, message.action.name)
+            .then(debugIt.bind(undefined, eventBus))
+            .then(() => {
+                try { tmpdirCleanupCallback(); } catch (e) { }
+                done(); // we don't need to "ok" here, as the invoker will do that for us
+            });
+        });
+        } catch (err) {
+        console.error(err);
+        console.error(err.stack);
+        try { tmpdirCleanupCallback(); } catch (e) { }
+        done();
+        }
+    });
     });
 };
diff --git a/client/lib/diff.js b/client/lib/diff.js
index c543e13..c9cd539 100644
--- a/client/lib/diff.js
+++ b/client/lib/diff.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,39 +41,39 @@
     var dataIndex = 1;
 
     if (!patch.hunks) {
-	//
-	// patch is a textual unified diff. parse it
-	//
-	patch = JsDiff.parsePatch(patch)[0];
+    //
+    // patch is a textual unified diff. parse it
+    //
+    patch = JsDiff.parsePatch(patch)[0];
     }
-    
+
     patch.hunks.forEach((hunk, hunkIndex) => {
-	for (var i = dataIndex; i < hunk.oldStart; i++) {
-	    newLines.push(lines[i - 1]);
-	}
+    for (var i = dataIndex; i < hunk.oldStart; i++) {
+        newLines.push(lines[i - 1]);
+    }
 
-	hunk.lines.forEach( (line, index) => {
-	    if (line.charAt(0) === '+') {
-		// new line
-		newLines.push(line.slice(1));
-		
-	    } else if (line.charAt(0) === '-') {
-		// removed line
-		dataIndex++;
-		
-	    } else if (line.charAt(0) !== '\\') {
-		// patch doesn't say anything about this line
-		newLines.push(lines[dataIndex++ - 1]);
-	    }
-	});
+    hunk.lines.forEach( (line, index) => {
+        if (line.charAt(0) === '+') {
+        // new line
+        newLines.push(line.slice(1));
 
-	dataIndex = hunk.oldStart + hunk.oldLines + 1;
+        } else if (line.charAt(0) === '-') {
+        // removed line
+        dataIndex++;
 
-	if (hunkIndex === patch.hunks.length - 1) {
-	    for (i = dataIndex - 1; i < lines.length; i++) {
-		newLines.push(lines[i]);
-	    }
-	}
+        } else if (line.charAt(0) !== '\\') {
+        // patch doesn't say anything about this line
+        newLines.push(lines[dataIndex++ - 1]);
+        }
+    });
+
+    dataIndex = hunk.oldStart + hunk.oldLines + 1;
+
+    if (hunkIndex === patch.hunks.length - 1) {
+        for (i = dataIndex - 1; i < lines.length; i++) {
+        newLines.push(lines[i]);
+        }
+    }
     });
 
     return newLines.join('\n');
@@ -80,44 +81,44 @@
 
 exports.checkIfFileChanged = function checkIfFileChanged(data1, f2, removeBootstrapPatch) {
     return new Promise((resolve, reject) => {
-	fs.readFile(f2, (err2, data2) => {
-	    try {
-		if (err2) {
-		    console.error('Error reading file', err2);
-		    reject(err2);
-		} else {
-		    data2 = data2.toString();
+    fs.readFile(f2, (err2, data2) => {
+        try {
+        if (err2) {
+            console.error('Error reading file', err2);
+            reject(err2);
+        } else {
+            data2 = data2.toString();
 
-		    if (removeBootstrapPatch) {
-			try {
-			    data2 = exports.applyPatch(data2, removeBootstrapPatch);
-			} catch (err) {
-			    console.error('Error applying patch', err);
-			    console.error(removeBootstrapPatch);
-			    console.error(err.stack);
-			}
-		    }
+            if (removeBootstrapPatch) {
+            try {
+                data2 = exports.applyPatch(data2, removeBootstrapPatch);
+            } catch (err) {
+                console.error('Error applying patch', err);
+                console.error(removeBootstrapPatch);
+                console.error(err.stack);
+            }
+            }
 
-		    var comparo;
-		    try {
-			comparo = JsDiff.createPatch('wskdb', data1, data2);
-		    } catch (err) {
-			console.error('Error creating patch', err);
-			console.error('D1', data1);
-			console.error('D2', data2);
-			console.error(err.stack);
-		    }
-		    if (comparo && comparo.indexOf('@@') >= 0) {
-			resolve(comparo);
-		    } else {
-			reject(false);
-		    }
-		}
-	    } catch (err) {
-		console.error('Error creating diff', err);
-		reject(err);
-	    }
-	});
+            var comparo;
+            try {
+            comparo = JsDiff.createPatch('wskdb', data1, data2);
+            } catch (err) {
+            console.error('Error creating patch', err);
+            console.error('D1', data1);
+            console.error('D2', data2);
+            console.error(err.stack);
+            }
+            if (comparo && comparo.indexOf('@@') >= 0) {
+            resolve(comparo);
+            } else {
+            reject(false);
+            }
+        }
+        } catch (err) {
+        console.error('Error creating diff', err);
+        reject(err);
+        }
+    });
     });
 };
 
@@ -127,14 +128,14 @@
 
 exports.rememberIfChanged = function rememberIfChanged(action, f2, cleanupF2, removeBootstrapPatch) {
     return exports.removeIfNotChanged(action.exec.code, f2, cleanupF2, removeBootstrapPatch)
-	.then(comparo => {
-	    if (comparo) {
-		outstandingDiffs[entityKey(action.namespace, action.name)] = {
-		    action: action,
-		    comparo: comparo
-		};
-	    }
-	});
+    .then(comparo => {
+        if (comparo) {
+        outstandingDiffs[entityKey(action.namespace, action.name)] = {
+            action: action,
+            comparo: comparo
+        };
+        }
+    });
 };
 
 exports.createPatch = function(data1, data2) {
diff --git a/client/lib/init.js b/client/lib/init.js
index dd468b9..c6584ed 100644
--- a/client/lib/init.js
+++ b/client/lib/init.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,112 +26,112 @@
 }
 function initDone() {
     try {
-	return !process.argv.find(s => s === '--reset' || s === '-r')
-	    && fs.statSync(MARKER).isFile()
-	    && fs.statSync('node_modules').isDirectory()
-	    && fs.statSync(nodejs6_deps).isDirectory();
+    return !process.argv.find(s => s === '--reset' || s === '-r')
+        && fs.statSync(MARKER).isFile()
+        && fs.statSync('node_modules').isDirectory()
+        && fs.statSync(nodejs6_deps).isDirectory();
     } catch (e) {
-	return false;
+    return false;
     }
 }
 
 exports.init = function init() {
     return new Promise((resolve, reject) => { try {
-	if (initDone()) {
-	    return resolve();
-	}
+    if (initDone()) {
+        return resolve();
+    }
 
-	console.log('>>> Please be patient while we finish up the installation of the OpenWhisk Debugger.');
-	console.log('>>> This may take around 30-60 seconds');
+    console.log('>>> Please be patient while we finish up the installation of the OpenWhisk Debugger.');
+    console.log('>>> This may take around 30-60 seconds');
 
-	var dot = '.';
-	var dots = setInterval(function() {
-	    process.stdout.write(dot);
-	}, 1000);
+    var dot = '.';
+    var dots = setInterval(function() {
+        process.stdout.write(dot);
+    }, 1000);
 
-	var allDone = function() {
-	    touch();
-	    clearInterval(dots);
+    var allDone = function() {
+        touch();
+        clearInterval(dots);
 
-	    console.log();
-	    console.log('>>> Great! The one-time initialization has completed.');
-	    console.log();
+        console.log();
+        console.log('>>> Great! The one-time initialization has completed.');
+        console.log();
 
-	    resolve();
-	};
-	var errDone = function(err) {
-	    console.error(err.stack);
-	    clearInterval(dots);
-	    reject(err);
-	};
+        resolve();
+    };
+    var errDone = function(err) {
+        console.error(err.stack);
+        clearInterval(dots);
+        reject(err);
+    };
 
-	var verbose = process.argv.find(s => s === '--verbose');
-	var stdio = ['pipe', verbose ? 'inherit' : 'pipe', 'pipe' ];
-	if (verbose) {
-	    dot = '';
-	}
-	
-	//
-	// first, we install the npm modules needed by wskdb
-	//
-	try {
-	    var args = ['install'];
-	    if (!process.argv.find(s => s === '--dev' || s === 'd')) {
-		//
-		// install dev dependencies
-		//
-		args.push('--production');
-	    }
-		try {
-		    /*		    if (err) {
-			return errDone(err);
-			}*/
-	    
-		    //
-		    // here, we install the prerequisities dictated by OpenWhisk nodejs actions
-		    //
-		    if (!verbose) {
-			dot = 'n';
-		    }
-		    exec('npm', ['install', '--production'], { cwd: nodejs6_deps, stdio: stdio }).on('exit', (err) => {
-			try {
-			    if (err) {
-				return errDone(err);
-			    }
+    var verbose = process.argv.find(s => s === '--verbose');
+    var stdio = ['pipe', verbose ? 'inherit' : 'pipe', 'pipe' ];
+    if (verbose) {
+        dot = '';
+    }
 
-			    if (process.argv.find(s => s === '--python' || s === '-p')) {
-				//
-				// here, we install the prerequisities dictated by OpenWhisk python actions
-				//
-				if (!verbose) {
-				    dot = 'p';
-				}
-				exec('pip', ['install', '-r', 'deps/python/requirements.txt'], { cwd: process.cwd(), stdio: stdio }).on('exit', (err) => {
-				    if (err) {
-					return errDone(err);
-				    }
+    //
+    // first, we install the npm modules needed by wskdb
+    //
+    try {
+        var args = ['install'];
+        if (!process.argv.find(s => s === '--dev' || s === 'd')) {
+        //
+        // install dev dependencies
+        //
+        args.push('--production');
+        }
+        try {
+            /*          if (err) {
+            return errDone(err);
+            }*/
 
-				    allDone();
-				});
-			    } else {
-				//
-				// user doesn't want python support
-				//
-				allDone();
-			    }
-			} catch (err) {
-			    return errDone(err);
-			}
-		    });
-		} catch (err) {
-		    return errDone(err);
-		}
+            //
+            // here, we install the prerequisities dictated by OpenWhisk nodejs actions
+            //
+            if (!verbose) {
+            dot = 'n';
+            }
+            exec('npm', ['install', '--production'], { cwd: nodejs6_deps, stdio: stdio }).on('exit', (err) => {
+            try {
+                if (err) {
+                return errDone(err);
+                }
 
-	} catch (err) {
-	    return errDone(err);
-	}
+                if (process.argv.find(s => s === '--python' || s === '-p')) {
+                //
+                // here, we install the prerequisities dictated by OpenWhisk python actions
+                //
+                if (!verbose) {
+                    dot = 'p';
+                }
+                exec('pip', ['install', '-r', 'deps/python/requirements.txt'], { cwd: process.cwd(), stdio: stdio }).on('exit', (err) => {
+                    if (err) {
+                    return errDone(err);
+                    }
+
+                    allDone();
+                });
+                } else {
+                //
+                // user doesn't want python support
+                //
+                allDone();
+                }
+            } catch (err) {
+                return errDone(err);
+            }
+            });
+        } catch (err) {
+            return errDone(err);
+        }
+
     } catch (err) {
-	console.error(err.stack);
+        return errDone(err);
+    }
+    } catch (err) {
+    console.error(err.stack);
     }
     });
 };
diff --git a/client/lib/main.js b/client/lib/main.js
index 86a8caa..0aedbc8 100644
--- a/client/lib/main.js
+++ b/client/lib/main.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,12 +29,12 @@
     propertiesParser = require('properties-parser'),
 
     api = {
-	host: 'https://openwhisk.ng.bluemix.net',
-	path: '/api/v1'
+    host: 'https://openwhisk.ng.bluemix.net',
+    path: '/api/v1'
     },
     broker = {
-	host: 'https://owdbg-broker.mybluemix.net',
-	path: '/ws/client/register'
+    host: 'https://owdbg-broker.mybluemix.net',
+    path: '/ws/client/register'
     };
 
 exports.main = function() {
@@ -59,56 +60,56 @@
     console.log('Welcome to the OpenWhisk Debugger'.red);
 
     if (commandLineOptions) {
-	for (var x in commandLineOptions) {
-	    if (commandLineOptions.hasOwnProperty(x)) {
-		console.log(('    + ' + commandLineOptionsConfig.find((o) => o.name === x).description).dim);
-	    }
-	}
+    for (var x in commandLineOptions) {
+        if (commandLineOptions.hasOwnProperty(x)) {
+        console.log(('    + ' + commandLineOptionsConfig.find((o) => o.name === x).description).dim);
+        }
+    }
     }
     console.log();
 
     var wskprops = propertiesParser.read(expandHomeDir('~/.wskprops'));
     if (!wskprops.NAMESPACE) {
-	wskprops.NAMESPACE = '_';
+    wskprops.NAMESPACE = '_';
     }
     var key = wskprops.AUTH;
     ws.send(JSON.stringify({
-	type: 'init',
-	key: key
+    type: 'init',
+    key: key
     }));
 
     var keepAlive = setInterval(function poke() {
-	try {
-	    ws.send(JSON.stringify({
-		type: 'keep-alive'
-	    }));
-	} catch (e) {
-	    console.error();
-	    console.error('It looks like your network went offline. Please restart wskdb when your network is live.');
-	    process.exit(1);
-	}
+    try {
+        ws.send(JSON.stringify({
+        type: 'keep-alive'
+        }));
+    } catch (e) {
+        console.error();
+        console.error('It looks like your network went offline. Please restart wskdb when your network is live.');
+        process.exit(1);
+    }
     }, 5000);
 
     process.on('SIGINT', () => {
-	//
-	// clean up all stubs
-	//
-	console.log('Cleaning up');
-	require('./rewriter').clean(wskprops, process.exit); // note: clean versus detachAll
+    //
+    // clean up all stubs
+    //
+    console.log('Cleaning up');
+    require('./rewriter').clean(wskprops, process.exit); // note: clean versus detachAll
     });
 
     process.on('exit', function onExit() {
-	try {
-	    // console.log('Goodbye!'.red);
-	    clearInterval(keepAlive);
+    try {
+        // console.log('Goodbye!'.red);
+        clearInterval(keepAlive);
 
-	    ws.send(JSON.stringify({
-		type: 'disconnect'
-	    }, function ack() {
-		ws.close();
-	    }));
-	} catch (e) {
-	}
+        ws.send(JSON.stringify({
+        type: 'disconnect'
+        }, function ack() {
+        ws.close();
+        }));
+    } catch (e) {
+    }
     });
 
     //
@@ -116,14 +117,14 @@
     //
     var attachTo;
     try {
-	attachTo = process.argv.slice(2).find(arg => {
-	    arg = arg.replace(/-/g, '');
-	    return !commandLineOptions.hasOwnProperty(arg) // not a long option
-		&& !commandLineOptionsConfig.find(opt => opt.short === arg); // and not a short option
-	});
+    attachTo = process.argv.slice(2).find(arg => {
+        arg = arg.replace(/-/g, '');
+        return !commandLineOptions.hasOwnProperty(arg) // not a long option
+        && !commandLineOptionsConfig.find(opt => opt.short === arg); // and not a short option
+    });
     } catch (e) {
-	// uncomment this for debugging:
-	// console.error('error',e);
+    // uncomment this for debugging:
+    // console.error('error',e);
     }
 
     repl(wskprops, eventBus, attachTo);
@@ -135,97 +136,97 @@
 
     var debugInProgress = false;
     eventBus.on('invocation-done', () => {
-	console.log('Debug session complete');
-	debugInProgress = false;
+    console.log('Debug session complete');
+    debugInProgress = false;
     });
-    
+
 ws.on('message', function(data, flags) {
     //console.log('MESSAGE ' + data + ' ||| ' + JSON.stringify(flags));
-    
+
     //
-    // flags.binary will be set if a binary data is received. 
+    // flags.binary will be set if a binary data is received.
     // flags.masked will be set if the data was masked.
     //
     try {
-	var message = JSON.parse(data);
-	switch (message.type) {
-	case 'invoke':
-	    var circuitBreaker = function circuitBreaker() {
-		ws.send(JSON.stringify({
-			type: 'circuit-breaker',
-			key: message.key,
-			activationId: message.activationId,
-		}));
-	    };
+    var message = JSON.parse(data);
+    switch (message.type) {
+    case 'invoke':
+        var circuitBreaker = function circuitBreaker() {
+        ws.send(JSON.stringify({
+            type: 'circuit-breaker',
+            key: message.key,
+            activationId: message.activationId,
+        }));
+        };
 
-	    if (debugInProgress) {
-		return circuitBreaker();
-	    }
+        if (debugInProgress) {
+        return circuitBreaker();
+        }
 
-	    debugInProgress = true;
-	    
-	    console.log('Debug session requested');
-	    // console.log(JSON.stringify(message, undefined, 4));
+        debugInProgress = true;
 
-	    var done = function done(err, result) {
-		// console.log('Finishing up this debug session');
+        console.log('Debug session requested');
+        // console.log(JSON.stringify(message, undefined, 4));
 
-		ws.send(JSON.stringify({
-		    type: err ? 'circuit-breaker' : 'end',
-		    key: message.key,
-		    activationId: message.activationId,
-		    result: result
-		}));
+        var done = function done(err, result) {
+        // console.log('Finishing up this debug session');
 
-		//ws.close();
-	    };
+        ws.send(JSON.stringify({
+            type: err ? 'circuit-breaker' : 'end',
+            key: message.key,
+            activationId: message.activationId,
+            result: result
+        }));
 
-	    if (message.onDone_trigger) {
-		if (message.action && message.action.exec) {
-		    var kind = message.action.exec.kind;
-		    var debugHandler;
-		    
-		    if (!kind || kind.indexOf('nodejs') >= 0) {
-			// !kind because nodejs is the default
-			debugHandler = debugNodeJS;
-		    } else if (kind.indexOf('swift') >= 0) {
-			debugHandler = debugSwift;
-		    } else if (kind.indexOf('python') >= 0) {
-			debugHandler = debugPython;
-		    }
+        //ws.close();
+        };
 
-		    if (debugHandler) {
-			debugHandler(message, ws, { trigger: message.onDone_trigger }, done, commandLineOptions, eventBus);
-		    } else {
-			console.error('Unable to complete invocation, because this action\'s kind is not yet handled: ' + kind);
-			circuitBreaker();
-		    }
+        if (message.onDone_trigger) {
+        if (message.action && message.action.exec) {
+            var kind = message.action.exec.kind;
+            var debugHandler;
 
-		} else {
-		    console.error('Unable to complete invocation: no action code to debug');
-		    circuitBreaker();
-		}
-	    } else {
-		console.error('Unable to complete invocation: no onDone_trigger specified');
-		circuitBreaker();
-	    }
+            if (!kind || kind.indexOf('nodejs') >= 0) {
+            // !kind because nodejs is the default
+            debugHandler = debugNodeJS;
+            } else if (kind.indexOf('swift') >= 0) {
+            debugHandler = debugSwift;
+            } else if (kind.indexOf('python') >= 0) {
+            debugHandler = debugPython;
+            }
 
-	    break;
-	}
+            if (debugHandler) {
+            debugHandler(message, ws, { trigger: message.onDone_trigger }, done, commandLineOptions, eventBus);
+            } else {
+            console.error('Unable to complete invocation, because this action\'s kind is not yet handled: ' + kind);
+            circuitBreaker();
+            }
+
+        } else {
+            console.error('Unable to complete invocation: no action code to debug');
+            circuitBreaker();
+        }
+        } else {
+        console.error('Unable to complete invocation: no onDone_trigger specified');
+        circuitBreaker();
+        }
+
+        break;
+    }
     } catch (e) {
-	console.log(e);
+    console.log(e);
     }
 });
 
 /*
-sending binary data 
+sending binary data
 ws.on('open', function open() {
   var array = new Float32Array(5);
- 
+
   for (var i = 0; i < array.length; ++i) {
     array[i] = i / 2;
   }
- 
+
   ws.send(array, { binary: true, mask: true });
 });
 */
diff --git a/client/lib/options.js b/client/lib/options.js
index 743b1d0..959f8ca 100644
--- a/client/lib/options.js
+++ b/client/lib/options.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,8 +22,8 @@
 
 exports.update = function update(key, f, wskprops, next, value) {
     if (value !== undefined) {
-	options[key] = value === 'true' || value === 't' || value === 'yes' || value === 'y' || value === 'on'
-	    ? true : false;
+    options[key] = value === 'true' || value === 't' || value === 'yes' || value === 'y' || value === 'on'
+        ? true : false;
     }
 
     console.log('Option ' + key + ' set to ' + ('' + (options[key] || false)).red);
diff --git a/client/lib/repl-messages.js b/client/lib/repl-messages.js
index 33e614d..1ffde86 100644
--- a/client/lib/repl-messages.js
+++ b/client/lib/repl-messages.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +17,8 @@
 
 exports.ok = function ok(next) {
     return function() {
-	console.log('ok');
-	next();
+    console.log('ok');
+    next();
     };
 };
 
@@ -27,26 +28,25 @@
 
 exports.okAfter = function okAfter(f, next) {
     return function() {
-	f.apply(undefined, arguments);
-	exports.ok_(next);
+    f.apply(undefined, arguments);
+    exports.ok_(next);
     };
 };
 
 /**
  * Log an error, and continue
- *
  */
 exports.errorWhile = function errorWhile(inOperation, callback) {
     return function(err) {
-	if (err && err.toString().indexOf('404')) {
-	    console.error('Error: entity does not exist while in this operation: ', inOperation);
-	} else {
-	    console.error('Error ' + inOperation);
-	    console.error(err);
-	}
-	
-	if (callback) {
-	    callback();
-	}
+    if (err && err.toString().indexOf('404')) {
+        console.error('Error: entity does not exist while in this operation: ', inOperation);
+    } else {
+        console.error('Error ' + inOperation);
+        console.error(err);
+    }
+
+    if (callback) {
+        callback();
+    }
     };
 };
diff --git a/client/lib/repl.js b/client/lib/repl.js
index 29eb302..e2229bd 100644
--- a/client/lib/repl.js
+++ b/client/lib/repl.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,29 +25,29 @@
 var commandHandlers; // defined below. helping out jshint here
 var help = {
     handler: function help() {
-	console.log('The available commands are:');
-	console.log();
+    console.log('The available commands are:');
+    console.log();
 
-	var grouped = {};
-	for (var x in commandHandlers) {
-	    if (commandHandlers.hasOwnProperty(x)) {
-		var already = grouped[commandHandlers[x].description];
-		if (already) {
-		    grouped[commandHandlers[x].description] = already + ', ' + x;
-		} else {
-		    grouped[commandHandlers[x].description] = x;
-		}
-	    }
-	}
-	
-	var pruned = [];
-	for (var d in grouped) {
-	    if (grouped.hasOwnProperty(d)) {
-		pruned.push({ command: grouped[d], description: d });
-	    }
-	}
+    var grouped = {};
+    for (var x in commandHandlers) {
+        if (commandHandlers.hasOwnProperty(x)) {
+        var already = grouped[commandHandlers[x].description];
+        if (already) {
+            grouped[commandHandlers[x].description] = already + ', ' + x;
+        } else {
+            grouped[commandHandlers[x].description] = x;
+        }
+        }
+    }
 
-	console.log(columnify(pruned, { minWidth: 18 }));
+    var pruned = [];
+    for (var d in grouped) {
+        if (grouped.hasOwnProperty(d)) {
+        pruned.push({ command: grouped[d], description: d });
+        }
+    }
+
+    console.log(columnify(pruned, { minWidth: 18 }));
     },
     description: 'Print this help text'
 };
@@ -64,8 +65,8 @@
 };
 var exit = {
     handler: function(wskprops) {
-	console.log('Cleaning up');
-	rewriter.clean(wskprops, process.exit); // note: clean versus detachAll
+    console.log('Cleaning up');
+    rewriter.clean(wskprops, process.exit); // note: clean versus detachAll
     },
     description: 'Quit the debugger',
     synchronous: true
@@ -154,7 +155,7 @@
     inspect: inspect,
     ins: inspect,
     get: inspect,
-    
+
     fire: fire,
     f: fire,
 
@@ -198,69 +199,69 @@
  */
 function repl(wskprops, eventBus, attachTo) {
     function handleReplCommand(response) {
-	if (response.command.length === 0) {
-	    // user hit return;
-	    return repl(wskprops, eventBus);
-	}
-	
-	var commandLine = response.command.split(/\s+/);
-	var command = commandLine.shift();
-	var handler = commandHandlers[command];
+    if (response.command.length === 0) {
+        // user hit return;
+        return repl(wskprops, eventBus);
+    }
 
-	var options;
-	if (handler.options) {
-	    argv.clear();
-	    argv.description = 'Usage: ' + command + ' [options]';
-	    argv.options.help.example = '';
-	    argv.options.help.onset = (args) => {
-		argv.help(args.mod);
-	    };
-	    options = argv.option(handler.options).run(commandLine).options;
-	}
+    var commandLine = response.command.split(/\s+/);
+    var command = commandLine.shift();
+    var handler = commandHandlers[command];
 
-	if (handler.synchronous) {
-	    // the second parameter is the call back to the repl
-	    // when done with the synchronous operation
-	    commandLine.unshift(repl.bind(undefined, wskprops, eventBus));
-	}
+    var options;
+    if (handler.options) {
+        argv.clear();
+        argv.description = 'Usage: ' + command + ' [options]';
+        argv.options.help.example = '';
+        argv.options.help.onset = (args) => {
+        argv.help(args.mod);
+        };
+        options = argv.option(handler.options).run(commandLine).options;
+    }
 
-	if (handler.options) {
-	    commandLine.unshift(options);
-	}
+    if (handler.synchronous) {
+        // the second parameter is the call back to the repl
+        // when done with the synchronous operation
+        commandLine.unshift(repl.bind(undefined, wskprops, eventBus));
+    }
 
-	if (handler.needsEventBus) {
-	    commandLine.unshift(eventBus);
-	}
+    if (handler.options) {
+        commandLine.unshift(options);
+    }
 
-	// the first parameter is wskprops
-	commandLine.unshift(wskprops);
+    if (handler.needsEventBus) {
+        commandLine.unshift(eventBus);
+    }
 
-	commandLine.push(response.command);
+    // the first parameter is wskprops
+    commandLine.unshift(wskprops);
 
-	// call to the handler!
-	try {
-	    handler.handler.apply(undefined, commandLine);
-	} catch (e) {
-	    console.error(e);
-	}
+    commandLine.push(response.command);
 
-	if (!handler.synchronous) {
-	    // if async, then restart the repl right away
-	    repl(wskprops, eventBus);
-	}
+    // call to the handler!
+    try {
+        handler.handler.apply(undefined, commandLine);
+    } catch (e) {
+        console.error(e);
+    }
+
+    if (!handler.synchronous) {
+        // if async, then restart the repl right away
+        repl(wskprops, eventBus);
+    }
     } /* end of handleReplCommand */
-    
+
     if (attachTo) {
-	handleReplCommand({ command: 'attach ' + attachTo });
+    handleReplCommand({ command: 'attach ' + attachTo });
     } else {
-	prompt.prompt([{
-	    name: 'command', message: '(wskdb)',
-	    prefixMessage: '', // override the default question mark prefix
-	    validate: function(line) {
-		var commandLine = line.split(/\s+/);
-		return line.length === 0 || commandHandlers[commandLine[0]] ? true : 'Invalid command';
-	    }
-	}]).then(handleReplCommand);
+    prompt.prompt([{
+        name: 'command', message: '(wskdb)',
+        prefixMessage: '', // override the default question mark prefix
+        validate: function(line) {
+        var commandLine = line.split(/\s+/);
+        return line.length === 0 || commandHandlers[commandLine[0]] ? true : 'Invalid command';
+        }
+    }]).then(handleReplCommand);
     }
 }
 
diff --git a/client/lib/rewriter.js b/client/lib/rewriter.js
index 2b675e7..2d8de22 100644
--- a/client/lib/rewriter.js
+++ b/client/lib/rewriter.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,11 +34,11 @@
     invokerActionName = 'invoker',
     invoker = invokerPackageName + '/' + invokerActionName,
     api = {
-	host: 'https://openwhisk.ng.bluemix.net',
-	path: '/api/v1'
+    host: 'https://openwhisk.ng.bluemix.net',
+    path: '/api/v1'
     },
     debugBroker = {
-	host: 'https://owdbg-broker.mybluemix.net'
+    host: 'https://owdbg-broker.mybluemix.net'
     };
 
 /** the dictionary of live attachments to actions */
@@ -53,11 +54,11 @@
 
 function echoContinuation(entity, entityNamespace) {
     return {
-	annotations: [{ key: 'debug', value: '/' + entityNamespace + '/' + entity }],
-	exec: {
-	    kind: 'nodejs:default',
-	    code: 'function main(params) { return params; }'
-	}
+    annotations: [{ key: 'debug', value: '/' + entityNamespace + '/' + entity }],
+    exec: {
+        kind: 'nodejs:default',
+        code: 'function main(params) { return params; }'
+    }
     };
 }
 
@@ -71,133 +72,133 @@
  */
 exports.clean = function clean(wskprops, next) {
     function cleanType(type) {
-	var types = type + 's';
-	// console.log('Cleaning ' + types);
+    var types = type + 's';
+    // console.log('Cleaning ' + types);
 
-	return new Promise(function(resolve, reject) {
-	    lister.list(wskprops, function onList(entities, ow) {
-		var toClean = entities.filter(function(entity) {
-		    return Namer.isDebugArtifact(entity.name);
-		});
-		var counter = toClean.length;
-		
-		if (counter === 0) {
-		    return resolve(toClean.length);
-		}
-		function _countDown(resolver) {
-		    if (--counter === 0) {
-			resolver(toClean.length);
-		    }
-		}
-		var countDownError = _countDown.bind(undefined, reject);
-		var countDown = _countDown.bind(undefined, resolve);
+    return new Promise(function(resolve, reject) {
+        lister.list(wskprops, function onList(entities, ow) {
+        var toClean = entities.filter(function(entity) {
+            return Namer.isDebugArtifact(entity.name);
+        });
+        var counter = toClean.length;
 
-		toClean.forEach(function(entity) {
-		    var params = {};
-		    params[type + 'Name'] = entity.name;
-		    function clean() {
-			ow[types].delete(params)
-			    .then(countDown)
-			    .catch(errorWhile('cleaning ' + entity.name, countDownError));
-		    }
-		    if (type === 'rule') {
-			doWithRetry(() => ow.rules.disable(params).then(clean));
-		    } else {
-			clean();
-		    }
-		});
-	    }, types);
-	});
+        if (counter === 0) {
+            return resolve(toClean.length);
+        }
+        function _countDown(resolver) {
+            if (--counter === 0) {
+            resolver(toClean.length);
+            }
+        }
+        var countDownError = _countDown.bind(undefined, reject);
+        var countDown = _countDown.bind(undefined, resolve);
+
+        toClean.forEach(function(entity) {
+            var params = {};
+            params[type + 'Name'] = entity.name;
+            function clean() {
+            ow[types].delete(params)
+                .then(countDown)
+                .catch(errorWhile('cleaning ' + entity.name, countDownError));
+            }
+            if (type === 'rule') {
+            doWithRetry(() => ow.rules.disable(params).then(clean));
+            } else {
+            clean();
+            }
+        });
+        }, types);
+    });
     }
 
     Promise.all([cleanType('action'),
-		 cleanType('trigger'),
-		 cleanType('package')
-		])
-	.then(() =>
-	    cleanType('rule')
-	      .then(ok(next))
-	      .catch(errorWhile('cleaning rules', next)))
-	.catch(errorWhile('cleaning actions and triggers', next));
+         cleanType('trigger'),
+         cleanType('package')
+        ])
+    .then(() =>
+        cleanType('rule')
+          .then(ok(next))
+          .catch(errorWhile('cleaning rules', next)))
+    .catch(errorWhile('cleaning actions and triggers', next));
 };
 
 var UpstreamAdapter = {
     createNames: function createUpstreamAdapterNames(continuationName) {
-	return {
-	    ruleName: Namer.name('continuation-rule'),
-	    triggerName: Namer.name('continuation-trigger'),
-	    continuationName: continuationName || Namer.name('continuation-action'),
-	    createContinuationPlease: !continuationName,
-	    debugStubName: Namer.name('stub')
-	};
+    return {
+        ruleName: Namer.name('continuation-rule'),
+        triggerName: Namer.name('continuation-trigger'),
+        continuationName: continuationName || Namer.name('continuation-action'),
+        createContinuationPlease: !continuationName,
+        debugStubName: Namer.name('stub')
+    };
     },
 
     invokerFQN: function(entityNamespace, names) {
-	return '/' + entityNamespace + '/' + names.debugStubName;// + '/' + invokerActionName;
+    return '/' + entityNamespace + '/' + names.debugStubName;// + '/' + invokerActionName;
     },
     invokerName: function(names) {
-	return names.debugStubName;// + '/' + invokerActionName;
+    return names.debugStubName;// + '/' + invokerActionName;
     },
 
     createInvoker: function createUpstreamAdapterInvoker_withActionClone(ow, names, actionBeingDebugged, actionBeingDebuggedNamespace) {
-	return new Promise((resolve, reject) => {
-	    fs.readFile(path.join(__dirname, '..', 'deps', 'invoker', 'owdbg-invoker.js'), (err, codeBuffer) => {
-		if (err) {
-		    reject(err);
-		} else {
-		    ow.actions.create({
-			actionName: names.debugStubName,
-			action: {
-			    parameters: [{ key: 'action', value: actionBeingDebugged },
-					 { key: 'namespace', value: actionBeingDebuggedNamespace },
-					 { key: 'broker', value: debugBroker.host },
-					 { key: 'onDone_trigger', value: names.triggerName }
-					],
-			    exec: {
-				kind: 'nodejs:default',
-				code: codeBuffer.toString('utf8')
-			    }
-			}
-		    }).then(resolve).catch(reject);
-		}
-	    });
-	});
+    return new Promise((resolve, reject) => {
+        fs.readFile(path.join(__dirname, '..', 'deps', 'invoker', 'owdbg-invoker.js'), (err, codeBuffer) => {
+        if (err) {
+            reject(err);
+        } else {
+            ow.actions.create({
+            actionName: names.debugStubName,
+            action: {
+                parameters: [{ key: 'action', value: actionBeingDebugged },
+                     { key: 'namespace', value: actionBeingDebuggedNamespace },
+                     { key: 'broker', value: debugBroker.host },
+                     { key: 'onDone_trigger', value: names.triggerName }
+                    ],
+                exec: {
+                kind: 'nodejs:default',
+                code: codeBuffer.toString('utf8')
+                }
+            }
+            }).then(resolve).catch(reject);
+        }
+        });
+    });
     },
     createInvoker_usingPackageBinding: function createUpstreamAdapterInvoker_usingPackageBinding(ow, names, actionBeingDebugged, actionBeingDebuggedNamespace) {
-	return ow.packages.create({ packageName: names.debugStubName,
-				    package: {
-					binding: {
-					    namespace: invokerPackageNamespace,
-					    name: invokerPackageName
-					},
-					parameters: [{ key: 'action', value: actionBeingDebugged },
-						     { key: 'namespace', value: actionBeingDebuggedNamespace },
-						     { key: 'onDone_trigger', value: names.triggerName }
-						    ]
-				    }
-				  });
+    return ow.packages.create({ packageName: names.debugStubName,
+                    package: {
+                    binding: {
+                        namespace: invokerPackageNamespace,
+                        name: invokerPackageName
+                    },
+                    parameters: [{ key: 'action', value: actionBeingDebugged },
+                             { key: 'namespace', value: actionBeingDebuggedNamespace },
+                             { key: 'onDone_trigger', value: names.triggerName }
+                            ]
+                    }
+                  });
     },
     create: function createUpstreamAdapter(ow, actionBeingDebugged, actionBeingDebuggedNamespace, names) {
-	try {
-	    if (!names) {
-		names = UpstreamAdapter.createNames();
-	    }
-	    var work = [
-		ow.triggers.create(names), // create onDone_trigger
-		UpstreamAdapter.createInvoker(ow, names, actionBeingDebugged, actionBeingDebuggedNamespace),
-	    ];
-	    if (names.createContinuationPlease) {
-		work.push(ow.actions.create({ actionName: names.continuationName, action: echoContinuation(actionBeingDebugged,
-													   actionBeingDebuggedNamespace) }));
-	    }
-	    return Promise.all(work)
-		.then(() => ow.rules.create({ ruleName: names.ruleName, trigger: '/_/'+names.triggerName, action: '/_/'+names.continuationName }),
-		      errorWhile('creating upstream adapter part 1'))
-		.then(() => names, errorWhile('creating upstream adapter part 2'));
-	} catch (e) {
-	    console.error(e);
-	    console.error(e.stack);
-	}
+    try {
+        if (!names) {
+        names = UpstreamAdapter.createNames();
+        }
+        var work = [
+        ow.triggers.create(names), // create onDone_trigger
+        UpstreamAdapter.createInvoker(ow, names, actionBeingDebugged, actionBeingDebuggedNamespace),
+        ];
+        if (names.createContinuationPlease) {
+        work.push(ow.actions.create({ actionName: names.continuationName, action: echoContinuation(actionBeingDebugged,
+                                                       actionBeingDebuggedNamespace) }));
+        }
+        return Promise.all(work)
+        .then(() => ow.rules.create({ ruleName: names.ruleName, trigger: '/_/'+names.triggerName, action: '/_/'+names.continuationName }),
+              errorWhile('creating upstream adapter part 1'))
+        .then(() => names, errorWhile('creating upstream adapter part 2'));
+    } catch (e) {
+        console.error(e);
+        console.error(e.stack);
+    }
     }
 };
 
@@ -207,11 +208,11 @@
  */
 var SequenceRewriter = {
     rewriteNeeded: function sequenceUses(sequenceEntityThatMaybeUses, entity, entityNamespace) {
-	var fqn = '/' + entityNamespace + '/' + entity;
+    var fqn = '/' + entityNamespace + '/' + entity;
 
-	return sequenceEntityThatMaybeUses.name !== entity
-	    && sequenceEntityThatMaybeUses.exec && sequenceEntityThatMaybeUses.exec.kind === 'sequence'
-	    && sequenceEntityThatMaybeUses.exec.components && sequenceEntityThatMaybeUses.exec.components.find((c) => c === fqn);
+    return sequenceEntityThatMaybeUses.name !== entity
+        && sequenceEntityThatMaybeUses.exec && sequenceEntityThatMaybeUses.exec.kind === 'sequence'
+        && sequenceEntityThatMaybeUses.exec.components && sequenceEntityThatMaybeUses.exec.components.find((c) => c === fqn);
     }
 };
 
@@ -221,39 +222,39 @@
      *
      */
     rewriteNeeded: function ruleUses(ruleEntityThatMaybeUses, entity, entityNamespace, isAnInstrumentedSequence) {
-	//var fqn = '/' + entityNamespace + '/' + entity;
+    //var fqn = '/' + entityNamespace + '/' + entity;
 
-	return ruleEntityThatMaybeUses.name !== entity
-	    && (ruleEntityThatMaybeUses.action.name === entity /*&& ruleEntityThatMaybeUses.action.path === entityNamespace*/
-		|| isAnInstrumentedSequence[ruleEntityThatMaybeUses.action]);
+    return ruleEntityThatMaybeUses.name !== entity
+        && (ruleEntityThatMaybeUses.action.name === entity /*&& ruleEntityThatMaybeUses.action.path === entityNamespace*/
+        || isAnInstrumentedSequence[ruleEntityThatMaybeUses.action]);
     },
 
     rewrite: function cloneRule(ow, ruleEntityWithDetails, entity, entityNamespace, names) {
-	if (ruleEntityWithDetails.action.name === entity) {
-	    //
-	    // then the rule is T => entity, so we can simply create a new rule T => debugStub
-	    //
-	    return ow.rules.create({ ruleName: Namer.name('rule-clone'),
-				     trigger: '/_/'+ruleEntityWithDetails.trigger.name,
-				     action: '/_/'+names.debugStubName
-				   })
-		.then(newRule => {
-		    chainAttached[ruleEntityWithDetails.name] = names;
-		    chainAttached[ruleEntityWithDetails.trigger.name] = names;
-		});
-	} else {
-	    var details = chainAttached[ruleEntityWithDetails.action.name];
-	    if (details) {
-		//
-		// this means the rule maps T => sequence, where the sequence directly contains entity [..., entity, ... ]
-		//
-		return ow.rules.create({ ruleName: Namer.name('rule-clone'),
-					 trigger: '/_/'+ruleEntityWithDetails.trigger.name,
-					 action: '/_/'+details.before
-				       })
-		    .then(newRule => chainAttached[ruleEntityWithDetails.name] = names);
-	    }
-	}
+    if (ruleEntityWithDetails.action.name === entity) {
+        //
+        // then the rule is T => entity, so we can simply create a new rule T => debugStub
+        //
+        return ow.rules.create({ ruleName: Namer.name('rule-clone'),
+                     trigger: '/_/'+ruleEntityWithDetails.trigger.name,
+                     action: '/_/'+names.debugStubName
+                   })
+        .then(newRule => {
+            chainAttached[ruleEntityWithDetails.name] = names;
+            chainAttached[ruleEntityWithDetails.trigger.name] = names;
+        });
+    } else {
+        var details = chainAttached[ruleEntityWithDetails.action.name];
+        if (details) {
+        //
+        // this means the rule maps T => sequence, where the sequence directly contains entity [..., entity, ... ]
+        //
+        return ow.rules.create({ ruleName: Namer.name('rule-clone'),
+                     trigger: '/_/'+ruleEntityWithDetails.trigger.name,
+                     action: '/_/'+details.before
+                       })
+            .then(newRule => chainAttached[ruleEntityWithDetails.name] = names);
+        }
+    }
     }
 };
 
@@ -262,93 +263,93 @@
 function afterSpliceSplitter(element, tackOnTheEnd, A) { A = A.slice(A.indexOf(element) + 1); return A; }
 function makeSequenceSplicePart(ow, name, sequence, splitter) {
     var opts = {
-	actionName: name,
-	action: {
-	    exec: {
-		kind: sequence.exec.kind,
-		code: '',
-		components: splitter(sequence.exec.components)
-	    }
-	}
+    actionName: name,
+    action: {
+        exec: {
+        kind: sequence.exec.kind,
+        code: '',
+        components: splitter(sequence.exec.components)
+        }
+    }
     };
     return ow.actions.create(opts);
 }
 function spliceSequence(ow, sequence, entity, entityNamespace, names) {
     try {
-	var finalBit;/*{
-	    actionName: Namer.name('action'),
-	    action: echoContinuation(entity, entityNamespace, spliceNames.onDone_trigger)
-	};*/
-	
-	var fqn = '/' + entityNamespace + '/' + entity;
+    var finalBit;/*{
+        actionName: Namer.name('action'),
+        action: echoContinuation(entity, entityNamespace, spliceNames.onDone_trigger)
+    };*/
 
-	var afterSpliceContinuation = Namer.name('sequence-splice-after', `for-${sequence.name}`);
-	var upstreamAdapterNames = UpstreamAdapter.createNames(afterSpliceContinuation);
+    var fqn = '/' + entityNamespace + '/' + entity;
 
-	var beforeSpliceUpstream = UpstreamAdapter.invokerFQN(entityNamespace, upstreamAdapterNames);
-	//var afterSpliceContinuation = '/' + entityNamespace + '/' + upstreamAdapterNames.continuationName;
+    var afterSpliceContinuation = Namer.name('sequence-splice-after', `for-${sequence.name}`);
+    var upstreamAdapterNames = UpstreamAdapter.createNames(afterSpliceContinuation);
 
-	return Promise.all([
-	    makeSequenceSplicePart(ow,
-				   Namer.name('sequence-splice-before'),
-				   sequence,
-				   beforeSpliceSplitter.bind(undefined, fqn, beforeSpliceUpstream)),   // before: _/--upstream
-	    makeSequenceSplicePart(ow,
-				   afterSpliceContinuation,
-				   sequence,
-				   afterSpliceSplitter.bind(undefined, fqn, finalBit)) // after: -\__continuation
+    var beforeSpliceUpstream = UpstreamAdapter.invokerFQN(entityNamespace, upstreamAdapterNames);
+    //var afterSpliceContinuation = '/' + entityNamespace + '/' + upstreamAdapterNames.continuationName;
 
-	]).then(beforeAndAfter => {
-	    //
-	    // after the breakpoint, continue with the afterSplice
-	    //
-	    return UpstreamAdapter.create(ow, entity, entityNamespace, upstreamAdapterNames)
-		.then(() => {
-		    //
-		    // this sequence splice uses its own downstream trigger, not the generic one from the action splice
-		    //
-		    var names = {
-			before: beforeAndAfter[0].name,
-			after: beforeAndAfter[1].name,
-			triggerName: upstreamAdapterNames.triggerName
-		    };
-		    chainAttached[sequence.name] = names;
-		    return names;
+    return Promise.all([
+        makeSequenceSplicePart(ow,
+                   Namer.name('sequence-splice-before'),
+                   sequence,
+                   beforeSpliceSplitter.bind(undefined, fqn, beforeSpliceUpstream)),   // before: _/--upstream
+        makeSequenceSplicePart(ow,
+                   afterSpliceContinuation,
+                   sequence,
+                   afterSpliceSplitter.bind(undefined, fqn, finalBit)) // after: -\__continuation
 
-		}, errorWhile('creating upstream adapter'));
-	}, errorWhile('splicing sequence'));
+    ]).then(beforeAndAfter => {
+        //
+        // after the breakpoint, continue with the afterSplice
+        //
+        return UpstreamAdapter.create(ow, entity, entityNamespace, upstreamAdapterNames)
+        .then(() => {
+            //
+            // this sequence splice uses its own downstream trigger, not the generic one from the action splice
+            //
+            var names = {
+            before: beforeAndAfter[0].name,
+            after: beforeAndAfter[1].name,
+            triggerName: upstreamAdapterNames.triggerName
+            };
+            chainAttached[sequence.name] = names;
+            return names;
+
+        }, errorWhile('creating upstream adapter'));
+    }, errorWhile('splicing sequence'));
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 }
 
 function doPar(ow, type, entity, each) {
     return new Promise((resolve, reject) => {
-	var types = type + 's';
-	ow[types].list({ limit: 200 })
-	    .then(entities => {
-		var counter = entities.length;
-		function countDown(names) {
-		    if (--counter <= 0) {
-			resolve();
-		    }
-		}
-		entities.forEach(otherEntity => {
-		    if (otherEntity.name === entity) {
-			// this is the entity itself. skip, because
-			// we're looking for uses in *other* entities
-			countDown();
+    var types = type + 's';
+    ow[types].list({ limit: 200 })
+        .then(entities => {
+        var counter = entities.length;
+        function countDown(names) {
+            if (--counter <= 0) {
+            resolve();
+            }
+        }
+        entities.forEach(otherEntity => {
+            if (otherEntity.name === entity) {
+            // this is the entity itself. skip, because
+            // we're looking for uses in *other* entities
+            countDown();
 
-		    } else {
-			var opts = { namespace: otherEntity.namespace };
-			opts[type + 'Name'] = otherEntity.name;
-			ow[types].get(opts)
-			    .then(otherEntityWithDetails => each(otherEntityWithDetails, countDown))
-			    .catch(errorWhile('processing one ' + type, countDown));
-		    }
-		});
-	    })
-	    .catch(errorWhile('processing ' + types, reject));
+            } else {
+            var opts = { namespace: otherEntity.namespace };
+            opts[type + 'Name'] = otherEntity.name;
+            ow[types].get(opts)
+                .then(otherEntityWithDetails => each(otherEntityWithDetails, countDown))
+                .catch(errorWhile('processing one ' + type, countDown));
+            }
+        });
+        })
+        .catch(errorWhile('processing ' + types, reject));
     });
 }
 
@@ -358,77 +359,77 @@
  */
 exports.attach = function attach(wskprops, options, next, entity) {
     if (options.help) {
-	// the user passed -h or --help, so there is nothing to do here
-	return next();
+    // the user passed -h or --help, so there is nothing to do here
+    return next();
     }
     if (!entity) {
-	console.error('Error: Please specify an entity ');
-	console.error();
-	return next();
+    console.error('Error: Please specify an entity ');
+    console.error();
+    return next();
     }
 
     try {
-	var entityNamespace = '_';//wskprops.NAMESPACE;
-	var ow = setupOpenWhisk(wskprops);
+    var entityNamespace = '_';//wskprops.NAMESPACE;
+    var ow = setupOpenWhisk(wskprops);
 
-	var doAttach = function doAttach() {
-	    console.log('Attaching'.blue + ' to ' + entity);
+    var doAttach = function doAttach() {
+        console.log('Attaching'.blue + ' to ' + entity);
 
-	    console.log('   Creating action trampoline'.green);
-	    UpstreamAdapter.create(ow, entity, entityNamespace).then(names => {
-		// remember the names, so that we can route invocations to the debug version
-		attached[entity] = names;
-		lastAttached = entity;
+        console.log('   Creating action trampoline'.green);
+        UpstreamAdapter.create(ow, entity, entityNamespace).then(names => {
+        // remember the names, so that we can route invocations to the debug version
+        attached[entity] = names;
+        lastAttached = entity;
 
-		if (!options || !options.all) {
-		    //
-		    // user asked not to instrument any rules or sequences
-		    //
-		    return ok_(next);
-		}
+        if (!options || !options.all) {
+            //
+            // user asked not to instrument any rules or sequences
+            //
+            return ok_(next);
+        }
 
-		// remember all sequences that include action, so that we can properly handle rules T -> sequence(..., action, ...)
-		var isAnInstrumentedSequence = {};
-		doPar(ow, 'action', entity, (otherEntityWithDetails, countDown) => {
-		    if (SequenceRewriter.rewriteNeeded(otherEntityWithDetails, entity, entityNamespace)) {
-			//
-			// splice the sequence!
-			//
-			console.log('   Creating sequence splice'.green, otherEntityWithDetails.name);
-			isAnInstrumentedSequence[otherEntityWithDetails.name] = true;
-			spliceSequence(ow, otherEntityWithDetails, entity, entityNamespace, names)
-			    .then(countDown)
-			    .catch(errorWhile('creating sequence splice', countDown));
-			
-		    } else {
-			countDown();
-		    }
-		}).then(() => {
-		    doPar(ow, 'rule', entity, (otherEntityWithDetails, countDown) => {
-			if (RuleRewriter.rewriteNeeded(otherEntityWithDetails, entity, entityNamespace, isAnInstrumentedSequence)) {
-			    //
-			    // clone the rule!
-			    //
-			    console.log('   Creating rule clone'.green, otherEntityWithDetails.name);
-			    RuleRewriter.rewrite(ow, otherEntityWithDetails, entity, entityNamespace, names)
-				.then(countDown, errorWhile('creating rule clone', countDown));
-			} else {
-			    countDown();
-			}
-		    }).then(ok(next)).catch(next);
-		}).catch(next);
-	    });
-	}; /* end of doAttach */
-	
-	//
-	// first fetch the action to make sure it exists (at least for now)
-	//
-	ow.actions.get({ actionName: entity })
-	    .then(doAttach)
-	    .catch(errorWhile('looking up action', next));
-	
+        // remember all sequences that include action, so that we can properly handle rules T -> sequence(..., action, ...)
+        var isAnInstrumentedSequence = {};
+        doPar(ow, 'action', entity, (otherEntityWithDetails, countDown) => {
+            if (SequenceRewriter.rewriteNeeded(otherEntityWithDetails, entity, entityNamespace)) {
+            //
+            // splice the sequence!
+            //
+            console.log('   Creating sequence splice'.green, otherEntityWithDetails.name);
+            isAnInstrumentedSequence[otherEntityWithDetails.name] = true;
+            spliceSequence(ow, otherEntityWithDetails, entity, entityNamespace, names)
+                .then(countDown)
+                .catch(errorWhile('creating sequence splice', countDown));
+
+            } else {
+            countDown();
+            }
+        }).then(() => {
+            doPar(ow, 'rule', entity, (otherEntityWithDetails, countDown) => {
+            if (RuleRewriter.rewriteNeeded(otherEntityWithDetails, entity, entityNamespace, isAnInstrumentedSequence)) {
+                //
+                // clone the rule!
+                //
+                console.log('   Creating rule clone'.green, otherEntityWithDetails.name);
+                RuleRewriter.rewrite(ow, otherEntityWithDetails, entity, entityNamespace, names)
+                .then(countDown, errorWhile('creating rule clone', countDown));
+            } else {
+                countDown();
+            }
+            }).then(ok(next)).catch(next);
+        }).catch(next);
+        });
+    }; /* end of doAttach */
+
+    //
+    // first fetch the action to make sure it exists (at least for now)
+    //
+    ow.actions.get({ actionName: entity })
+        .then(doAttach)
+        .catch(errorWhile('looking up action', next));
+
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 };
 
@@ -437,27 +438,27 @@
 
     var count = 0;
     function done() {
-	if (--count <= 0) {
-	    if (next) {
-		next();
-	    }
-	}
+    if (--count <= 0) {
+        if (next) {
+        next();
+        }
     }
-    
+    }
+
     for (var entity in attached) {
-	if (attached.hasOwnProperty(entity)) {
-	    count++;
-	}
+    if (attached.hasOwnProperty(entity)) {
+        count++;
+    }
     }
 
     if (count === 0) {
-	done();
+    done();
     } else {
-	for (entity in attached) {
-	    if (attached.hasOwnProperty(entity)) {
-		exports.detach(wskprops, done, entity);
-	    }
-	}
+    for (entity in attached) {
+        if (attached.hasOwnProperty(entity)) {
+        exports.detach(wskprops, done, entity);
+        }
+    }
     }
 };
 
@@ -465,71 +466,71 @@
     console.log('Detaching'.blue + ' from ' + entity);
 
     function errlog(idx, noNext) {
-	return function(err) {
-	    if (err.indexOf && err.indexOf('HTTP 404') < 0) {
-		console.error('Error ' + idx, err);
-	    }
-	    if (!noNext) {
-		next();
-	    }
-	};
+    return function(err) {
+        if (err.indexOf && err.indexOf('HTTP 404') < 0) {
+        console.error('Error ' + idx, err);
+        }
+        if (!noNext) {
+        next();
+        }
+    };
     }
-    
+
     var names = attached[entity];
     if (names) {
-	try {
-	    var ow = setupOpenWhisk(wskprops);
-	    ow.rules.disable(names)
-		.then(() => {
-		    try {
-			// first delete the action and rule and debug package
-			Promise.all([ow.triggers.delete(names),
-				     ow.actions.delete({ actionName: names.continuationName }),
-				     ow.actions.delete({ actionName: names.debugStubName }) // keep in sync with UpstreamAdapter
-				    ])
-			    .then(() => {
-				// then we can delete the rule
-				ow.rules.delete(names)
-				    .then(() => {
-					try {
-					    delete attached[entity];
-					    ok_(next);
-					} catch (err) {
-					    errlog(5, true)(err);
-					}
-				    }).
-				    catch(errlog(4));
-			    })
-			    .catch(errlog(3));
-		    }
-		    catch (err) { errlog(2, true)(err); }
-		}).catch(errlog(1));
-	} catch (err) {
-	    errlog(0)(err);
-	}
+    try {
+        var ow = setupOpenWhisk(wskprops);
+        ow.rules.disable(names)
+        .then(() => {
+            try {
+            // first delete the action and rule and debug package
+            Promise.all([ow.triggers.delete(names),
+                     ow.actions.delete({ actionName: names.continuationName }),
+                     ow.actions.delete({ actionName: names.debugStubName }) // keep in sync with UpstreamAdapter
+                    ])
+                .then(() => {
+                // then we can delete the rule
+                ow.rules.delete(names)
+                    .then(() => {
+                    try {
+                        delete attached[entity];
+                        ok_(next);
+                    } catch (err) {
+                        errlog(5, true)(err);
+                    }
+                    }).
+                    catch(errlog(4));
+                })
+                .catch(errlog(3));
+            }
+            catch (err) { errlog(2, true)(err); }
+        }).catch(errlog(1));
+    } catch (err) {
+        errlog(0)(err);
+    }
     }
 }
 exports.detach = function detach(wskprops, next, entity) {
     if (!entity) {
-	var L = [];
-	for (var x in attached) {
-	    if (attached.hasOwnProperty(x)) {
-		L.push(x);
-	    }
-	}
-	if (L.length === 0) {
-	    console.error('No attached actions detected');
-	    next();
-	} else {
-	    inquirer
-		.prompt([{ name: 'name', type: 'list',
-			   message: 'From which action do you wish to detach',
-			   choices: L
-			 }])
-		.then(function(response) { doDetach(wskprops, next, response.name); });
-	}
+    var L = [];
+    for (var x in attached) {
+        if (attached.hasOwnProperty(x)) {
+        L.push(x);
+        }
+    }
+    if (L.length === 0) {
+        console.error('No attached actions detected');
+        next();
     } else {
-	doDetach(wskprops, next, entity);
+        inquirer
+        .prompt([{ name: 'name', type: 'list',
+               message: 'From which action do you wish to detach',
+               choices: L
+             }])
+        .then(function(response) { doDetach(wskprops, next, response.name); });
+    }
+    } else {
+    doDetach(wskprops, next, entity);
     }
 };
 
@@ -539,9 +540,9 @@
  */
 exports.invoke = function invoke() {
     try {
-	exports._invoke.apply(undefined, arguments);
+    exports._invoke.apply(undefined, arguments);
     } catch (e) {
-	console.error(e);
+    console.error(e);
     }
 };
 exports._invoke = function invoke() {
@@ -556,64 +557,64 @@
     var type = isTrigger ? 'triggers' : 'actions';
 
     if (!action || action === '-p' || action === 'invoke') {
-	//
-	// user did not provide an action
-	//
-	if (action) {
-	    args.unshift(action);
-	}
+    //
+    // user did not provide an action
+    //
+    if (action) {
+        args.unshift(action);
+    }
 
-	action = lastAttached;
+    action = lastAttached;
     }
 
     var params = {};
     for (var i = 0; i < args.length; i++) {
-	if (args[i] === '-p') {
-	    params[args[++i]] = args[++i];
-	}
+    if (args[i] === '-p') {
+        params[args[++i]] = args[++i];
+    }
     }
 
     var invokeThisAction, waitForThisAction;
-    
+
     var attachedTo = attached[action];
     if (isTrigger) {
-	invokeThisAction = action;
-	waitForThisAction = chainAttached[action].continuationName;
-	
-    } else if (!attachedTo) {
-	var seq = chainAttached[action];
-	if (seq) {
-	    if (seq.before) {
-		// sequence
-		invokeThisAction = seq.before;
-		waitForThisAction = seq.after;
-	    } else {
-		// rule: invoke the rule's action
-		invokeThisAction = seq.debugStubName;
-		waitForThisAction = seq.continuationName;
-	    }
+    invokeThisAction = action;
+    waitForThisAction = chainAttached[action].continuationName;
 
-	} else {
-	    invokeThisAction = action;
-	    waitForThisAction = action;
-	}
+    } else if (!attachedTo) {
+    var seq = chainAttached[action];
+    if (seq) {
+        if (seq.before) {
+        // sequence
+        invokeThisAction = seq.before;
+        waitForThisAction = seq.after;
+        } else {
+        // rule: invoke the rule's action
+        invokeThisAction = seq.debugStubName;
+        waitForThisAction = seq.continuationName;
+        }
 
     } else {
-	invokeThisAction = UpstreamAdapter.invokerName(attachedTo);
+        invokeThisAction = action;
+        waitForThisAction = action;
+    }
 
-	// these are now part of the debug stub binding
-	// params.action = action;
-	// params.namespace = namespace;
-	// params.onDone_trigger = attachedTo.triggerName;
+    } else {
+    invokeThisAction = UpstreamAdapter.invokerName(attachedTo);
 
-	waitForThisAction = attachedTo.continuationName;
+    // these are now part of the debug stub binding
+    // params.action = action;
+    // params.namespace = namespace;
+    // params.onDone_trigger = attachedTo.triggerName;
+
+    waitForThisAction = attachedTo.continuationName;
     }
 
     //console.log('Invoking', action);
-    
+
     if (!action) {
-	console.error('Please provide an action to invoke'.red);
-	return next();
+    console.error('Please provide an action to invoke'.red);
+    return next();
     }
 
     var ow = setupOpenWhisk(wskprops);
@@ -623,8 +624,8 @@
     // doesn't look for previous invocations of the given action
     //
     mostRecentEnd(wskprops)
-	.then(since => ow[type].invoke({ name: invokeThisAction, params: params })
-	      .then(() => waitForActivationCompletion(wskprops, eventBus, waitForThisAction, { result: true, since: since })
-		    .then(ok(next)))
-	      .catch(errorWhile(`invoking your specified ${isTrigger ? 'trigger' : 'action'}`, next)));
+    .then(since => ow[type].invoke({ name: invokeThisAction, params: params })
+          .then(() => waitForActivationCompletion(wskprops, eventBus, waitForThisAction, { result: true, since: since })
+            .then(ok(next)))
+          .catch(errorWhile(`invoking your specified ${isTrigger ? 'trigger' : 'action'}`, next)));
 };
diff --git a/client/lib/util.js b/client/lib/util.js
index 78e266b..00a59d5 100644
--- a/client/lib/util.js
+++ b/client/lib/util.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +17,8 @@
 
 var openwhisk = require('openwhisk'),
     api = {
-	host: 'https://openwhisk.ng.bluemix.net',
-	path: '/api/v1'
+    host: 'https://openwhisk.ng.bluemix.net',
+    path: '/api/v1'
     };
 
 /**
@@ -27,8 +28,8 @@
 exports.setupOpenWhisk = function setupOpenWhisk(wskprops) {
     var key = wskprops.AUTH;
     var ow = openwhisk({
-	api: api.host + api.path,
-	api_key: key
+    api: api.host + api.path,
+    api_key: key
     });
     return ow;
 };
diff --git a/client/test/basic/launchAndQuit.js b/client/test/basic/launchAndQuit.js
index 7fc277e..6d1a7ad 100644
--- a/client/test/basic/launchAndQuit.js
+++ b/client/test/basic/launchAndQuit.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,17 +20,17 @@
 
 it('should launch and quit without error', t => {
     return new Promise((resolve,reject) => {
-	var child = spawn('node', ['wskdb.js'], { cwd: '../..' })
-	child.stdin.write('q\n');
-	
-	child.stderr.on('data', (data) => {
-	    console.error('stderr: ' + data)
-	})
-	/*child.stdout.on('data', (data) => {
-	})*/
-	child.on('exit', (code) => {
-	    if (code == 0) resolve()
-	    else reject(code)
-	})
+    var child = spawn('node', ['wskdb.js'], { cwd: '../..' })
+    child.stdin.write('q\n');
+
+    child.stderr.on('data', (data) => {
+        console.error('stderr: ' + data)
+    })
+    /*child.stdout.on('data', (data) => {
+    })*/
+    child.on('exit', (code) => {
+        if (code == 0) resolve()
+        else reject(code)
+    })
     }).then(result => t.is(result))
 });
diff --git a/client/test/commands/list.js b/client/test/commands/list.js
index d1b1bd7..1473f16 100644
--- a/client/test/commands/list.js
+++ b/client/test/commands/list.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,27 +20,27 @@
 
 it('should enumerate actions and quit without error', t => {
     return new Promise((resolve,reject) => {
-	var child = spawn('node', ['wskdb.js'], { cwd: '../..' })
-	child.stdin.write('l\n')
+    var child = spawn('node', ['wskdb.js'], { cwd: '../..' })
+    child.stdin.write('l\n')
 
-	child.stderr.on('data', (data) => {
-	    console.error('stderr: ' + data)
-	})
+    child.stderr.on('data', (data) => {
+        console.error('stderr: ' + data)
+    })
 
-	var goody = false;
-	child.stdout.on('data', (data) => {
-	    // console.log('stdout: ' + data);
-	    if (data.indexOf('Error') >= 0) {
-		goody = false
+    var goody = false;
+    child.stdout.on('data', (data) => {
+        // console.log('stdout: ' + data);
+        if (data.indexOf('Error') >= 0) {
+        goody = false
 
-	    } else if (data.indexOf('ok') >= 0) {
-		child.stdin.write('q\n')
-		goody = true
-	    }
-	});
-	child.on('exit', (code) => {
-	    if (code == 0 && goody) resolve()
-	    else reject('code=${code} goody=${goody}')
-	});
+        } else if (data.indexOf('ok') >= 0) {
+        child.stdin.write('q\n')
+        goody = true
+        }
+    });
+    child.on('exit', (code) => {
+        if (code == 0 && goody) resolve()
+        else reject('code=${code} goody=${goody}')
+    });
     }).then(result => t.is(result))
 });
diff --git a/client/test/helpers/driver.js b/client/test/helpers/driver.js
index b0b2590..cc026fc 100644
--- a/client/test/helpers/driver.js
+++ b/client/test/helpers/driver.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,119 +28,119 @@
 
 function doTest(expectFailure, shouldDoThisSuccessfully, stepFn, args, rootPath) {
     return test(shouldDoThisSuccessfully, t => {
-	return new Promise((resolve,reject) => {
-	    const child = spawn('node', ['wskdb.js'].concat(args || []), { cwd: rootPath || '../..' });
+    return new Promise((resolve,reject) => {
+        const child = spawn('node', ['wskdb.js'].concat(args || []), { cwd: rootPath || '../..' });
 
-	    const name = Namer.name('test');
-	    const steps = stepFn(name);
-	    
-	    var stepNumber = 0;
-	    var goody;
+        const name = Namer.name('test');
+        const steps = stepFn(name);
 
-	    // for the dead man's switch
-	    var lastStep;
-	    var lastOut;
-	    var expectedOutput, gotExpectedOutput;
+        var stepNumber = 0;
+        var goody;
 
-	    function doStep() {
-		var step = steps[stepNumber++];
+        // for the dead man's switch
+        var lastStep;
+        var lastOut;
+        var expectedOutput, gotExpectedOutput;
 
-		if (typeof step == "object") {
-		    expectedOutput = step.expectedOutput;
-		    gotExpectedOutput = false;
-		    step = step.input;
-		}
+        function doStep() {
+        var step = steps[stepNumber++];
 
-		// console.log("STEP".green, step, expectedOutput, typeof step);
-		
-		lastStep = Date.now();
-		child.stdin.write(step + '\n');
-	    }
-	    function redoStep() {
-		// console.log(("REDO STEP " + steps[stepNumber]).red);
-		child.stdin.write(steps[stepNumber - 1] + '\n');
-	    }
-	    doStep(); // do the first step
+        if (typeof step == "object") {
+            expectedOutput = step.expectedOutput;
+            gotExpectedOutput = false;
+            step = step.input;
+        }
 
-	    setInterval(function deadMansSwitch() {
-		if (lastStep > lastOut || (lastOut - lastStep < 100 && Date.now() - lastStep > 2000)) {
-		    redoStep();
-		}
-	    }, 2000);
+        // console.log("STEP".green, step, expectedOutput, typeof step);
 
-	    function errorInOutput(err) {
-		goody = false;
-		if (expectFailure) {
-		    resolve();
-		    return true;
-		} else {
-		    reject('Step ' + (stepNumber - 1) + ' failed: ' + steps[stepNumber - 1] + ' with ' + err);
-		    return false;
-		}
-	    }
-	    
-	    child.stderr.on('data', (data) => {
-		if (data.toString().indexOf('Error') >= 0) {
-		    if (errorInOutput(data.toString())) {
-			//
-			// don't print the error, as this was expected
-			//
-			return;
-		    }
-		}
-		console.error(('stderr: ' + data).red);
-	    });
+        lastStep = Date.now();
+        child.stdin.write(step + '\n');
+        }
+        function redoStep() {
+        // console.log(("REDO STEP " + steps[stepNumber]).red);
+        child.stdin.write(steps[stepNumber - 1] + '\n');
+        }
+        doStep(); // do the first step
 
-	    child.stdout.on('data', (data) => {
-		// console.log('stdout: '.blue + data);
-		lastOut = Date.now(); // for the dead man's switch
-		
-		if (data.indexOf('Error') >= 0) {
-		    errorInOutput(data);
-			
-		} else if (data.indexOf('ok') == 0
-			   || data.indexOf('\nok\n') >= 0
-			   || data.indexOf('break in') >= 0
-			   || data.indexOf('(Pdb)') >= 0
-			   || data.indexOf('stopped') >= 0) {
-		    //
-		    // the cumulative goodness is: if we are good so
-		    // far (or this is our first step) and either we
-		    // have no expected output, or we got it
-		    //
-		    goody = goody === undefined || goody && !expectedOutput || gotExpectedOutput;
+        setInterval(function deadMansSwitch() {
+        if (lastStep > lastOut || (lastOut - lastStep < 100 && Date.now() - lastStep > 2000)) {
+            redoStep();
+        }
+        }, 2000);
 
-		    // reset the got expected output bit
-		    expectedOutput = undefined;
-		    gotExpectedOutput = false;
+        function errorInOutput(err) {
+        goody = false;
+        if (expectFailure) {
+            resolve();
+            return true;
+        } else {
+            reject('Step ' + (stepNumber - 1) + ' failed: ' + steps[stepNumber - 1] + ' with ' + err);
+            return false;
+        }
+        }
 
-		    if (stepNumber === steps.length) {
-			stepNumber = -1;
-			child.stdin.write('quit\n');
-			child.stdin.end();
-		    } else if (stepNumber >= 0) {
-			doStep();
-		    }
-		} else if (expectedOutput && data.indexOf(expectedOutput) >= 0) {
-		    gotExpectedOutput = true;
-		}
-	    });
-	    child.on('exit', (code) => {
-		if (code === 0 && goody) {
-		    if (expectFailure) {
-			reject('zero exit code');
-		    } else {
-			resolve();
-		    }
-		} else {
-		    if (expectFailure) {
-			resolve();
-		    } else {
-			reject();
-		    }
-		}
-	    });
-	}).then(result => t.is(result));
+        child.stderr.on('data', (data) => {
+        if (data.toString().indexOf('Error') >= 0) {
+            if (errorInOutput(data.toString())) {
+            //
+            // don't print the error, as this was expected
+            //
+            return;
+            }
+        }
+        console.error(('stderr: ' + data).red);
+        });
+
+        child.stdout.on('data', (data) => {
+        // console.log('stdout: '.blue + data);
+        lastOut = Date.now(); // for the dead man's switch
+
+        if (data.indexOf('Error') >= 0) {
+            errorInOutput(data);
+
+        } else if (data.indexOf('ok') == 0
+               || data.indexOf('\nok\n') >= 0
+               || data.indexOf('break in') >= 0
+               || data.indexOf('(Pdb)') >= 0
+               || data.indexOf('stopped') >= 0) {
+            //
+            // the cumulative goodness is: if we are good so
+            // far (or this is our first step) and either we
+            // have no expected output, or we got it
+            //
+            goody = goody === undefined || goody && !expectedOutput || gotExpectedOutput;
+
+            // reset the got expected output bit
+            expectedOutput = undefined;
+            gotExpectedOutput = false;
+
+            if (stepNumber === steps.length) {
+            stepNumber = -1;
+            child.stdin.write('quit\n');
+            child.stdin.end();
+            } else if (stepNumber >= 0) {
+            doStep();
+            }
+        } else if (expectedOutput && data.indexOf(expectedOutput) >= 0) {
+            gotExpectedOutput = true;
+        }
+        });
+        child.on('exit', (code) => {
+        if (code === 0 && goody) {
+            if (expectFailure) {
+            reject('zero exit code');
+            } else {
+            resolve();
+            }
+        } else {
+            if (expectFailure) {
+            resolve();
+            } else {
+            reject();
+            }
+        }
+        });
+    }).then(result => t.is(result));
     });
 } /* the end of it! */
 
diff --git a/invoker/owdbg-invoker.js b/invoker/owdbg-invoker.js
index 2be3803..cf40a81 100644
--- a/invoker/owdbg-invoker.js
+++ b/invoker/owdbg-invoker.js
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,83 +19,83 @@
 
 function main(params) {
     return new Promise(function(resolve, reject) {
-	console.log('Invoking', params);
+    console.log('Invoking', params);
 
-	try {
-	//
-	// remove debugging payload from the parameters we send to the debug session
-	//
-	var actualParameters = Object.assign({}, params);
-	delete actualParameters.action;
-	delete actualParameters.broker;
-	delete actualParameters.namespace;
-	delete actualParameters.onDone_trigger;
+    try {
+    //
+    // remove debugging payload from the parameters we send to the debug session
+    //
+    var actualParameters = Object.assign({}, params);
+    delete actualParameters.action;
+    delete actualParameters.broker;
+    delete actualParameters.namespace;
+    delete actualParameters.onDone_trigger;
 
-	    console.log('A');
-	var opts = {
-	    url: params.broker + '/invoke/begin',
-	    method: 'POST',
-	    headers: {
-		'Accept': 'application/json'
-	    },
-	    json: true,
-	    body: {
-		key: process.env.__OW_API_KEY,
-		action: params.action,
-		namespace: params.namespace,
-		onDone_trigger: params.onDone_trigger,
-		actualParameters: actualParameters
-	    }
-	};
+        console.log('A');
+    var opts = {
+        url: params.broker + '/invoke/begin',
+        method: 'POST',
+        headers: {
+        'Accept': 'application/json'
+        },
+        json: true,
+        body: {
+        key: process.env.__OW_API_KEY,
+        action: params.action,
+        namespace: params.namespace,
+        onDone_trigger: params.onDone_trigger,
+        actualParameters: actualParameters
+        }
+    };
 
-	console.log('with options', opts);
-	
-	request(opts, function(err, response, body) {
-	    if (err || response.statusCode != 200) {
-		if (err) console.log('OOPS1 ' + JSON.stringify(err));
-		else console.log('OOPS1b ' + JSON.stringify(response) + ' ' + JSON.stringify(body));
-		reject(body);
-	    } else {
-		console.log('YUMMO ' + JSON.stringify(body));
-		var activationId = body.activationId;
+    console.log('with options', opts);
 
-		console.log('Ok, so far so good with activationId ' + activationId);
-		if (params.onDone_trigger) {
-		    resolve({ status: "ok" });
-		} else {
-		    var timer = setInterval(function() {
-			request({
-			    url: actualParameters.broker + '/invoke/status/' + activationId,
-			    method: 'GET',
-			    headers: {
-				'Accept': 'application/json',
-				'Content-Type': 'application/json',
-				'AuthKey': process.env.__OW_API_KEY
-			    },
-			}, function(err, response, body) {
-			    if (err || response.statusCode != 200) {
-				if (err) console.log('OOPS2 ' + JSON.stringify(err));
-				else console.log('OOPS2b ' + JSON.stringify(response));
-				reject(body);
-			    } else {
-				try {
-				    // body = JSON.parse(body);
-				    //console.log("Result? " + body.result + " " + body);
-				    if (body.result !== undefined) {
-					clearInterval(timer);
-					resolve(body.result);
-				    }
-				} catch (e) {
-				    console.log("Could not parse result");
-				    reject(body);
-				}
-			    }
-			}); 
-		    }, 1000);
-		}
-	    }
-	});
-	} catch (e) { console.error(e.stack); reject(e); }
+    request(opts, function(err, response, body) {
+        if (err || response.statusCode != 200) {
+        if (err) console.log('OOPS1 ' + JSON.stringify(err));
+        else console.log('OOPS1b ' + JSON.stringify(response) + ' ' + JSON.stringify(body));
+        reject(body);
+        } else {
+        console.log('YUMMO ' + JSON.stringify(body));
+        var activationId = body.activationId;
+
+        console.log('Ok, so far so good with activationId ' + activationId);
+        if (params.onDone_trigger) {
+            resolve({ status: "ok" });
+        } else {
+            var timer = setInterval(function() {
+            request({
+                url: actualParameters.broker + '/invoke/status/' + activationId,
+                method: 'GET',
+                headers: {
+                'Accept': 'application/json',
+                'Content-Type': 'application/json',
+                'AuthKey': process.env.__OW_API_KEY
+                },
+            }, function(err, response, body) {
+                if (err || response.statusCode != 200) {
+                if (err) console.log('OOPS2 ' + JSON.stringify(err));
+                else console.log('OOPS2b ' + JSON.stringify(response));
+                reject(body);
+                } else {
+                try {
+                    // body = JSON.parse(body);
+                    //console.log("Result? " + body.result + " " + body);
+                    if (body.result !== undefined) {
+                    clearInterval(timer);
+                    resolve(body.result);
+                    }
+                } catch (e) {
+                    console.log("Could not parse result");
+                    reject(body);
+                }
+                }
+            });
+            }, 1000);
+        }
+        }
+    });
+    } catch (e) { console.error(e.stack); reject(e); }
     });
 }
 //main({'broker':'https://owdbg.mybluemix.net','action':'foo/bar15'})