When China throttled exports of rare earth elements this year, American and European policymakers were thrown into a panic.