Standarize the concept of document links.

* Define links and a way to query them.
* Optionally define roles.
* Test it.