Modularize content click handling, fix handling of relative references to find named anchors as well