Endogenous Education Duration, Fertility Choice, and Mortality: A Framework for Optimal Population Policy