Add suport for AMD, CommonJS and global definitions