Stochastic Spectral Embedding In Forward And Inverse Uncertainty Quantification