Folsom, Kent, and Ono used the theory of modular forms modulo to establish remarkable "self-similarity" properties of the partition function and give an overarching explanation of many partition congruences. We generalize their work to analyze powers p r of the partition function as well as Andrews's spt-function. By showing that certain generating functions reside in a small space made up of reductions of modular forms, we set up a general framework for congruences for p r and spt on arithmetic progressions of the form m n + δ modulo powers of . Our work gives a conceptual explanation of the exceptional congruences of p r observed by Boylan, as well as striking congruences of spt modulo 5, 7, and 13 recently discovered by Andrews and Garvan.