Added loop to reconnect when the connection is dropped
Counts words
Checks to see if a filename was specified.  If not, uses the default name.