The image messaging app's valuation skyrocketed in one of the tech industry's most anticipated IPOs. Here's how it got there.