Nepal 's parliament has voted to abolish the country 's centuries-old monarchy and change to a republic .