Add AMD support

Added detection of AMD define() so that marked registers itself as a module in an AMD environment.  Simple, loader-agnostic test case included, but I've also tested it with curl.js and RequireJS.