Reverted my version to be equivalent to John's head

So that I can actually make changes that you will accept in the future, I branched off the crazy stuff I did and moved the master branch to be completely in sync with your branch. Can you verify this (github claims no differences) and accept this pull request. I'll then go through and re-do the important changes/fixes that haven't already been fixed by others. -h