exit gracefully in the absence of words.txt, and other code cleanup