var Visor = window.Visor || new function() {
    var cache = [];
    var readyFns = [];

    function addEvent(name, args) {
        cache.push([name, args]);
    }

    var events = ['setGoal', 'addTag', 'addAttribute', 'setFetchUrl', 'setUserName', 'setUserId', 'captureFunctions', 'sendPageContent'];
    for (var i = 0; i < events.length; i++) {
        this[events[i]] = function(name) {
            return function() {
                addEvent(name, arguments);
            };
        }(events[i]);
    }

    this.ready = function(fn, scope) {
        readyFns.push([fn, scope]);
    };

    this._getCache = function() {
        return cache.slice(0);
    };

    this._getReadyFns = function() {
        return readyFns.slice(0);
    };
}();