Make global export of require optional, async detection fixed.