pathtools: Move debug functions to main.