Added AMD output to build, `npm run-script dist-amd`.

Not the prettiest code (definitely a hack), but it adds better support for AMD via something like require.js.