replace `new function` pattern with IIFE and fixes errors in example code
remove unecessary function.bind call (artifact from old codebase)
Merge pull request #381 from kayellpeee/update_to_IIFEs

Update to IIFEs