Modularity and Optimal Design of Product Families