A Theory of the Allocation of Time and Goods Over the Life Cycle