A Model of Carbon and Nitrogen Dynamics for Temperate Grasslands and Forests