Add a cache

This should greatly speed up the mods performance. Previously it would
run the regex for each message in the chat log, which would get
amazingly slow over time.