Simultaneous refinement of orbital states, non-gravitational characteristics and residual forces using multivariate optimisation