Basic escaping is done only. Fancy hex sequences are not covered, but this should otherwise take care of the most common issues. Fixes #497
- fetch more complete refs for tags (may download more history than required, but it works) - Fix comparison of tag distance by using lists everywhere