A nun who carried out a sadistic campaign of abuse against vulnerable children at two Scots care homes has been jailed.