Most of what is written here comes directly from this classic paper. Specifically within a correlational analysis framework, a moderator is a third variable that affects the zero-order correlation between two other variables.
Mediators explain how external physical events take on internal psychological significance.
The general test for mediation is to examine the relation between the predictor and the criterion variables, the relation between the predictor and the mediator variables, and the relation between the mediator and criterion variables. All of these correlations should be significant. Another way to think about this issue is that a moderator variable is one that influences the strength of a relationship between two other variables, and a mediator variable is one that explains the relationship between the two other variables. Age might be a moderator variable, in that the relation between SES and BSE could be stronger for older women and less strong or nonexistent for younger women. When you remove the effect of education, the relation between SES and BSE disappears.