Hydrometallurgical recovery of rare earth elements from mine tailings and WEEE