More work on tutorial and minor code refactoring to mesh
well with tutorial.
Work on tutorial.  Small code changes to make it more teachable.