Add docstrings, including some of my critique of Scholz and BDM.

Also, allow script to be run from the command line.