addExtension = function addExtension(type, name, fn) {

	// type does not exist
	if (!Extensions[type]) {
		throw 'Can\'t add extension with type of "' + type + '", "' + type + '" is not a valid extension type. The following types are valid: ' + keysToList(Extensions);
	}

	// if is invalid name
	if (!/^[-a-z]+$/.test(name)) {
		throw 'Can\'t add extension with name "' + name + '", "' + name + '" is contains invalid characters. Only lowercase alphabetical characters and dashes are allowed.';
	}

	// name in type already exists 
	if (Extensions[type][name]) {
		throw 'Can\'t add extension with name "' + name + '", "' + name + '" is already added.';
	}

	// add
	Extensions[type][name] = fn;
}
Adds an extension function by type
@param type
@param name
@param fn
@returns {null}