C++ event dispatcher inspired by NodeJS EventEmitter