add CommonJS and AMD support