Made main js file amd-compliant