Categorical Foundations for Extended Compositional Distributional Models of Meaning