implemented term caching and mgrep dictionary creation process