merge xref resolution in base, refint in expand-gentext, cleanup tables, pis