Add timeouts and cleaner EventEmitter
Add tests