bin/grep-gtags: move the tag rewrite logic into emacs lisp.

Signed-off-by: Bao Haojun <baohaojun@gmail.com>