Rewrite build tests as smaller unit tests, plus other code changes & fixes
Detect infinite symlink loops and skip them with an error message