THE ALGEBRAIC THEORY OF MODULAR SYSTEMS