Indian Prime Minister Narendra Modi sworn in for a rare third term after weeks of voting in the world's largest democracy.