Simple js module to work with custom events