Kac-Moody group representations and generalization of the Sugawara construction of the Virasoro algebra