CarGurus to buy majority stake in CarOffer