Added checks for module.exports and define.amd.
Merge pull request #12 from ahume/amdsupport

Allow AMD compilation/loading