hc: Tighten up update_links()

- Make sure we never overwrite a non-symlink
- Check the link text and update the link if the text doesn't match

This means we can unconditionally call update_link() and it will do the
right thing in all cases, which makes the algorithms that use it
slightly simpler.
hc: Compatibility with Python 2.6

Python 2.6 doesn't have OrderedDict (it was added in 2.7).  Don't use
OrderedDict so we can run on older systems (with only py2.6).
hc refresh: Fix a couple corner cases when linking

If $HOME has symlinks in the path, we need to use the realpath or we
will base symlinks off the wrong path (and relative symlinks themselves
will be wrong).

Also, handle the case where we enable packages outside of $HOME -- fall
back to using absolute paths in that case.