Expressing and Exploiting the Common Subgoal Structure of Classical Planning Domains Using Sketches: Extended Version