This makes for an interesting read, old but awesome: http://darcyclarke.me/development/library-agnostic-pubsub-publish-subscribe/