Operator orderings and functional formulations of quantum and stochastic dynamics