Abstracts WordDictionary class to permit taking an arbitrary valid word set instead of a path to file, more flexible and easier for testing.