Drive the steps of the tutorial using trial and unittest

This is a sketch of how I thought we could address #577 and #315

For design review and comment.