Change all namespaces and update JS to use CommonJS interface