shakespear test, output result to file & code clean up

To test the program Shakespear texts (downloaded from PG) are used. text
import had to be added and revised, and an output module had to be
written that saves results in text file.