Remove log.readlines

This refactors (and adds tests for) the steps that use log.readlines.  Fortunately, it's a pretty easy refactor!