More tests and more cleanups
Added tests for xref checking
Some test cleanups