PathExists() and CheckLFS() moved to util/lfs, plus some code cleanup