Stochastic calculus of looping sequences for the modelling and simulation of cellular pathways