Conformal blocks and generalized theta functions