Added EventEmitter, various improvements.