function getModuleBody(program) {
    if (program.body.length !== 1) {
        return null;
    }
    if (program.body[0].type !== 'ExpressionStatement') {
        return null;
    }
    var expression = program.body[0].expression;
    if (expression.type === 'CallExpression') {
        var callee = expression.callee;
        var args = expression.arguments;

        // full file IIFE
        if (isFunctionExpression(callee)) {

            // detect UMD Shim, where the file body is the body of the factory,
            // which is the sole argument to the IIFE
            if (args.length === 1 && isFunctionExpression(args[0])) {
                return args[0].body;
            } else {
                return callee.body;
            }
        }

        // full file IIFE with call/apply
        if (
            callee.type === 'MemberExpression' &&
            callee.property.type === 'Identifier' &&
            (callee.property.name === 'apply' || callee.property.name === 'call')
        ) {
            if (isFunctionExpression(callee.object)) {
                return callee.object.body;
            }
        }

        // require / define
        if (callee.type === 'Identifier' && (callee.name === 'define' || callee.name === 'require')) {
            for (var i = 0; i < args.length; i++) {
                var arg = args[i];
                if (isFunctionExpression(arg)) {
                    return arg.body;
                }
            }
        }
    }

    return null;
}
Returns module block statement. Works with IIFE, require, define.

@param {Program} program
@returns {BlockStatement|null}