Estimation and Inference for Spatial and Spatio-Temporal Mixed Effects Models