added word counting, changed output to csvwriter

also made file number counter more general and cleaner (no longer tied
to having specific number of "non-html" files in the folder