updated js files to be AMD modules