trait/pubsub: IOC event listening

Backported from Backbone.Events for IOC event listening.
Also changed line ending from dos to unix.