A modular algebra for the description of crystal structures