Procedural Generalization by Planning with Self-Supervised World Models