CommonJSification and cleanup.