Implement link() and add a test

(Another pretty trivial one, -> automerge.)