Germany clinched top spot in Group B of the Women's World Cup after a 4-0 defeat of South Africa in Montpellier.