adding source code, and tests for AMD loading