The U.S. electric car company has topped Germany's Volkswagen to become the second most valuable automaker in the world.