A class of modular and flexible covariate-based covariance functions for nonstationary spatial modeling