amd support for js file

Another PR that adds amd support for projects that use it.