updated stream approach to return a modified stream that proxies the on() method so emitted "data" events are captured. by returning a modified CursorStream, we can pipe write stream into it in addition to directly responding to events