In a matter of months, Alphabet went from a market underperformer to knocking on the door of the $4 trillion club.