[folding addon] Rewrite tagRangeFinder

Closes #1360