(function (root, factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define([], factory);
    } else {
        // Browser globals (root is window)
        root.ably = factory();
  }
}(this, function () {
    'use strict';

    var Ably = {},
    tests = [],

    addTest = function (params) {
        tests.push(params);
    },

    getTests = function () {
        return tests;
    },

    when = function (test, variant, callback) {

    };

    // exported functions
    Ably.addTest = addTest;
    Ably.when = when;
    Ably.getTests = getTests;

    return Ably;
}));

@@ -171,16 +171,249 @@
 ctory);%0A
+    %7D else if (typeof exports === 'object') %7B%0A        // Node. Does not work with strict CommonJS, but%0A        // only CommonJS-like environments that support module.exports,%0A        // like Node.%0A        module.exports = factory();%0A
     %7D el

Add an exports-type module definition