nunaliit2-js: Add ability to tiled display to accept an external
function to determine the related documents from the currently selected
one.

Issue #217