Nepal 's Maoists fought a bloody , 10-year war against the government before joining the political mainstream in 2006 , and then winning the most votes during elections last year that helped bring an end to the Himalayan country 's centuries-old monarchy .