added updateFunction hook to allow real-time replacement of user logic
Added an Emitter class