Nonparametric perspectives on empirical Bayes