Analyzes a text file for words and returns top N words sorted by frequency