Converted compat.js to use namespaces