Restructuring the code so it looks more like the updated resulting code in the original post of intfiction.org forum. I'm going to just copy the result in to the master branch and continue the post-by-post commits in a "prehistory" branch.