The arithmetic theory of loop groups. II: The Hilbert-modular case Around the general theory of weight systems. I: Theory of singularities, the general Weyl group and its relation to the theory of invariants 