extractModel = function (source, type) {
        source = source[type] || source; // extract object that holds variable. these usually come from cloud API
        if (!_.isObject(source)) {
            return undefined;
        }

        // ensure we un-box the JSON if it comes from cloud-api or similar sources
        !source.values && _.isObject(source[type]) && (source = source[type]);

        // we ensure that environment passed as array is converted to plain object. runtime does this too, but we do it
        // here for consistency of options passed to reporters
        return source;
    }
Accepts an object, and extracts the property inside an object which is supposed to contain the required data.
In case of variables, it also extracts them into plain JS objects.

@param {Object} source - The source wrapper object that may or may not contain inner wrapped properties.
@param {String} type - "environment" or "globals", etc.
@returns {Object} - The object representation of the current extracted property.