Refactor hunspell to allow virtualization of file I/O