Add support for EventEmitter if it's available.
Add option for looping.