The value and cost of modularity: A cognitive perspective