Major refactor and cleaning:

1. I converted the text files to Markdown and removed html markup.
2. Cleaned up the code and fixed issues like loading required packages and fixing a few typos that caused errors

BUT: there scripts do not run cleanly! the main problem is the stats script, but the figures one also has issues (not all caused by the fact that it depends upon the unsourced stats script).  Thse require fixing and I will open an issue.