Treatment of constants of motion in the variation principle. Symmetry properties of variational wavefunctions