Subsampled Power Iteration: a Unified Algorithm for Block Models and Planted CSP's