Made compatible with AMD/CommonJS