afs: Move some ls-related stuff from afs.h to aft.c.