This isn't as hard as you make it out to be.
If your driverless car hits another car, your respective insurance companies pay for it unless it can be shown that you showed negligence. There is no liability for anyone. It goes from a case of assigning blame to treating it like getting cancer. Your medical insurance doesn't assign blame. It just pays out. You pay enough so that the insurance company always makes a buck. End of story. If a car company showed gross negligence, maybe someone could take legal action against them, but if occasionally shit happens and that is life, the simple and easy solution is just to have insurance be no-fault unless someone did something stupid, like modify the software. This is how most insurance works. Car insurance just starts to act like normal insurance.
In the case of your car killing someone, again, it is simple. Your insurance just acts like normal insurance. Your insurance company just pays out unless it can be shown that the pedestrian did something stupid and is own their own (like dive in front of the car). Again, if the software really bit the bullet, maybe you could try and hit the car company, but for the most part your insurance simply pays out and that is the end of the story.
The real change would be in insurance price. Your insurance price will probably swing based upon how good the car is at avoiding accidents. A car with a slow stopping speed and 5 year old software is going to be more expensive to insure than an agile car that can stop quickly and has the latest software. It is a boring numbers games that actuaries will have a field day with. You will probably have lower insurance rates regardless because the cost to insure for insurance companies will bottom out. You will have fewer accidents and blow less money on trying to determine liability. It will mean that they can score the same profit doing a whole lot less work, It is a win for everyone.
People are over thinking this trying to apply a world of liability to a world where there is little to none. If you break the speed limit, the cops might pull you over, but it will be just to check that your software and sensors are not screwed up, and maybe a warning to get your car checked out, not to give you a ticket.