Remove -mode suffix, add required "ends here" comment
Replace hand-rolled root code with vc-root / locate-dominating-file combo