Updating master branch to include David Crocker's improvements.  Plus a little tidying.