hgrep - speed it up and do a bit of cleanup