Asymptotic Theory for Solutions in Generalized M-Estimation and Stochastic Programming