 		String.prototype.request = (data) ->
 			Untangle.request(this, data)
 
+	@subscribeAll: (callback) ->
+		unless typeof callback == "function"
+			throw new Error "Callback not a function"
+		subscribersAll[callback] = callback
+
+	@unSubscribeAll: (callback) ->
+		delete subscribersAll[callback]
+
+	@reroute: (fromType, toType, callback=true) ->
+		unless reroutes[fromType]
+			reroutes[fromType] = {}
+		
+		reroutes[fromType][toType] = callback
+
+	@unReroute: (fromType, toType) ->
+		delete reroutes[fromType][toType] if reroutes[fromType] && reroutes[fromType][toType]
+
 module.exports = Untangle

class Untangle
	subscribers = {}
	responders = {}

	@subscribe: (type, callback) ->
		unless typeof callback == "function"

		if subscribers[type]
			for subscriber in subscribers[type]
				setTimeout(subscriber(data), 0)

		for subscribesToAll, callback of subscribersAll
			setTimeout(callback(type, data), 0)

		if reroutes[type]
			for toType, callback of reroutes[type]
				if typeof callback == "function"
					Untangle.publish(toType, callback(data))
				else
					Untangle.publish(toType, data)

	@request: (type, data) ->
		return responders[type](data) if responders[type]
		return null
