At least 29 people are dead and the prime minister has resigned following days of protests in Nepal over a social media ban that officials eventually lifted.