a partial reversion.

something broke, and it was difficult to tell when.  so I'm going back
to versions of the 3 key files that represent the state of the code
prior to my recent work.  recent work has been incorporated as
comments, but the functional part of the code should be identical to
what it was last week.