updated stat1.json
added logic for restricting run. added new logic (as a result of the logic in the diagram being updated). added more tests. added documentation (both POD for most of the code, and a script to produce html documentation, and also a pandoc script that produces a pdf manual of the whole codebase).