CommonJS module: pass events from IPC

Resolves #322