[pubfile, get_dirents] fixed bugs, use ajax to get group repos, clean up code