The Goldilocks Contract: The Synergistic Benefits of Combining Structure and Autonomy for Persistence, Creativity, and Cooperation