Composing decoherence functionals