function loadModule(data, scope) {
    // Create circuit element
    var obj = new modules[rectifyObjectType(data.objectType)](data.x, data.y, scope, ...data.customData.constructorParamaters || []);
    // Sets directions
    obj.label = data.label;
    obj.labelDirection = data.labelDirection || oppositeDirection[fixDirection[obj.direction]];

    // Sets delay
    if (data.propagationDelay === 0) {
        obj.propagationDelay = 0;
    } else {
        obj.propagationDelay = data.propagationDelay || obj.propagationDelay;
    }
    obj.fixDirection();

    // Restore other values
    if (data.customData.values) {
        for (var prop in data.customData.values) {
            obj[prop] = data.customData.values[prop];
        }
    }

    // Replace new nodes with the correct old nodes (with connections)
    if (data.customData.nodes) {
        for (const node in data.customData.nodes) {
            const n = data.customData.nodes[node];
            if (n instanceof Array) {
                for (let i = 0; i < n.length; i++) {
                    obj[node][i] = replace(obj[node][i], n[i]);
                }
            } else {
                obj[node] = replace(obj[node], n);
            }
        }
    }
    if(data.subcircuitMetadata)
        obj.subcircuitMetadata = data["subcircuitMetadata"];
}
Function to load CircuitElements
@param {JSON} data - JSOn data
@param {Scope} scope - circuit in which we want to load modules
@category data