How Tesla emerged from the brink of bankruptcy to become America's coolest car company