Don't warn twice about undefined reference links.

It was warning once when trying to lookup the URL, and again on the
lookup for the optional title.

Also: Give a clearer error message, "Reference link not defined"
(instead of "Unresolved reference"). Possible to do so because as of
commit 4df5a95f the code only handles reference links. Likewise,
rename `get-ref` to `get-linkref`.

Also: Add or correct some function "comment contracts".