Added function that counts lines in files in a given directory.