Switch whilst for eachSeries

Clean up things a bit by using eachSeries in place of whilst where
appropriate.