Taming Dr. Frankenstein: Contract-Based Design for Cyberphysical Systems