Add support for CommonJS and AMD.