Okay, trying this again

taking ringmaster's advice and creating a new branch, that should be
cut from current master this time. Dropping in my changes, and leaving
code comments in, whether I think they are useful or not :)

This is a proposed fix for #481