Rework: Move {#reference} handling out of mdx_defs into mdx_references.