Second-Order Variational Analysis in Optimization, Variational Stability, and Control