getDefs' lookup emb a extracts all used definitions
(functions, data/record types) from a, embedded into a monoid via emb.
Instantiations of meta variables are obtained via lookup.
Typical monoid instances would be [QName] or Set QName.
Note that emb can also choose to discard a used definition
by mapping to the unit of the monoid.