South Africa given billions to end reliance on coal