Towards a Categorical Foundation of Mathematics