Add dictionary for labels

Add dictionary for labels implemented as hash table.
Each set of rules has its own dictionary of rules to avoid
race conditions between processes. Each rule only keeps ids
of labels in a dictionary instead of whole label as a string.