Computing with rational symmetric functions and applications to invariant theory and PI-algebras