Fixing AMD support

Existing AMD support didn't quite work, tested with Require.js. This small change fixes PubSub for AMD.