Flow control library inspired by EventEmitter