Intelligent find and replace for require() calls