introduce Reference and Link base traits and refactor tree model
for consistent usage of these traits, including generalized handling of
markup source for unresolved references