Add AMD and CommonJS support