Module Decomposition and Integration Optimizes Gene Regulatory and Metabolic Networks