Plans to legalise assisted dying in Scotland pass have passed the first stage after MSPs voted in favour of the bill.