Add handling of ref and ptr including special handling of target patterns that reference resources and searching within them. Handle tei:front in explain views. Use common ref/ptr handling in glossary-explain and profile.