The rise of self-driving cars and automated technology is forcing us to ask some tough moral questions about the future of these machines.