Bayesian Networks, Markov Networks, Moralisation, Triangulation: a Categorical Perspective