How to build a circular economy for rare-earth elements