Wrap all commonjs modules in IIFE. Removed unsued variables
Fix test due to code refactoring