Snap to buy AR company WaveOptics for over $500M