change tregex to process a directory at a time, use json for patterns and tregex results