Quasi-martingales and stochastic integrals