State-dependent metabolic partitioning and energy conservation: A theoretical framework for understanding the function of sleep