Holistic Optimization of Modular Robots