Cache tag names from configuration.

Since they're looked up quite often, they should be cached insteadof going through the ConfigParser machinery.
Precompile match regexes.