Updated all core JS files to use commonJS syntax