Modular and conformal invariance constraints in representation theory of affine algebras