Simplified textfile_sizes() and replaced all get_linemax() calls with it.