BRST invariant operator formalism and string perturbation theory