The systematic formulation of models of stage-structured populations