Fix for event listeners not being called for nodejs modules + reworked example