Fix EventEmitter mixin

/to @raymondfeng 

Mixin is missing a check for typeof function... Breaks code generated by `slc lb model`.