Update tpath.lua

Change comment terminology. Make helper functions local.