Gamma (co)homology of commutative algebras and some related representations of the symmetric group