A package for outer-package communications By outer-package, I mean outside of this package - this can be the DOM or other packages.  This package has a basic event system and a basic registry.  It also has a debugger which allows you to fiddle with the DOM by removing and adding entire sets of tags.  Later it might have things which allow it to Debug /  Configure the server via ajax.

Please review all aspects of this code.

/***************************************************************************************************
    **COMS
    **  provides registry, event system, debugger ...
    **  reduces dependencies
    ***************************************************************************************************/

    (function () {
        "use strict";
        var $A,

            // public
            $P = {};

        // require utility
        (function manageGlobal() {
            if (window.$A &amp;&amp; window.$A.pack &amp;&amp; window.$A.pack.utility) {
                $A = window.$A;
                $A.pack.comms = true;
            } else {
                throw "comms requires utility module";
            }
        }());
        $P.Debug = (function () {
            var publik = {},
                hold = {};
            publik.addTags = function (tag) {
                if (hold[tag]) {
                    $A.someIndex(hold[tag], function (val) {
                        if (tag === 'script' || tag === 'style') {
                            document.head.appendChild(val);
                        } else {
                            document.body.appendChild(val);
                        }
                    });
                }
            };
            publik.removeTags = function (tag) {
                var styles = document.getElementsByTagName(tag),
                    i;
                hold[tag] = [];
                for (i = styles.length; i; i--) {
                    hold[tag][i] = styles[i];
                    $A.removeElement((styles[i]));
                }
            };
            publik.removeStorage = function () {
                localStorage.clear();
                sessionStorage.clear();
            };
            return publik;
        }());

        // a basic registry pattern with get/set and getMany/setMany
        $P.Reg = (function () {
            var publik = {},
                register = {};
            publik.get = function (key) {
                return register[key];
            };
            publik.set = function (key, value) {
                register[key] = value;
            };
            publik.setMany = function (o) {
                $A.someKey(o, function (val, key) {
                    register[key] = val;
                });
            };
            publik.getMany = function () {
                return register;
            };
            return publik;
        }());

        // a basic event system using an internal bus
        $P.Event = (function () {
            var publik = {},
                events = {};
            publik.add = function (name, callback) {
                if (!events[name]) {
                    events[name] = [];
                }
                events[name].push(callback);
            };
            publik.remove = function (name, callback) {
                if (name &amp;&amp; callback) {
                    delete events[name][callback];
                } else if (name) {
                    delete events[name];
                }
            };
            publik.trigger = function (name) {
                if (events[name]) {
                    $A.someIndex(events[name], function (val) {
                        val();
                    });
                }
            };
            return publik;
        }());
        window.$A = $A.extendSafe($A, $P);
    }());
The below code would be cleaner with object literal notation :

    // a basic registry pattern with get/set and getMany/setMany
    $P.Reg = (function () {
        var publik = {},
            register = {};
        publik.get = function (key) {
            return register[key];
        };
        publik.set = function (key, value) {
            register[key] = value;
        };
        publik.setMany = function (o) {
            $A.someKey(o, function (val, key) {
                register[key] = val;
            });
        };
        publik.getMany = function () {
            return register;
        };
        return publik;
    }());


would be

    // a basic registry pattern with get/set and getMany/setMany
    $P.Reg = (function () {
        var register = {};
        return {
            get : function (key) {
                return register[key];
            },
            set : function (key, value) {
                register[key] = value;
            },
            setMany : function (o) {
                $A.someKey(o, function (val, key) {
                    register[key] = val;
                });
            },
            getMany : function () {
                return register;
            }
        };
    }());


I also note that


getMany is wrongly named, getAll perhaps ?
not sure what someKey does, is it any different from for( var key in o) ?