hc: More link-handling cleanups

One function update_link() now ensures that a link points to where it's
supposed to.  This is better than having separate delete/create steps
because we don't have to re-compute the link text twice.

It also fixes a bug where we weren't computing the link text correctly
for overlay links, so we were needlessly removing/re-creating them.