function remapSubflowNodes(nodes,nodeMap) {
    for (var id in nodes) {
        if (nodes.hasOwnProperty(id)) {
            var node = nodes[id];
            if (node.wires) {
                var outputs = node.wires;
                for (var j=0;j<outputs.length;j++) {
                    var wires = outputs[j];
                    for (var k=0;k<wires.length;k++) {
                        if (nodeMap[outputs[j][k]]) {
                            outputs[j][k] = nodeMap[outputs[j][k]].id
                        } else {
                            outputs[j][k] = null;
                        }
                    }
                }
            }
            if ((node.type === 'complete' || node.type === 'catch' || node.type === 'status') && Array.isArray(node.scope)) {
                node.scope = node.scope.map(function(id) {
                    return nodeMap[id]?nodeMap[id].id:""
                })
            } else {
                for (var prop in node) {
                    if (node.hasOwnProperty(prop) && prop !== '_alias') {
                        if (nodeMap[node[prop]]) {
                            node[prop] = nodeMap[node[prop]].id;
                        }
                    }
                }
            }
        }
    }
}
Given an object of {id:nodes} and a map of {old-id:node}, modifiy all
properties in the nodes object to reference the new node ids.
This handles:
 - node.wires,
 - node.scope of Complete, Catch and Status nodes,
 - node.XYZ for any property where XYZ is recognised as an old property
@param  {[type]} nodes   [description]
@param  {[type]} nodeMap [description]
@return {[type]}         [description]