Rare earth batteries and lithium iron phosphate batteries