Solution of few-body problems with the stochastic variational method I. Central forces with zero orbital momentum