Tesla ended last year on a roll, with investors increasingly buying into Elon Musk’s ebullience about autonomous vehicles.