Modelling homotopy n-types in algebraic topology and category theory