Replace sourceCmd with a much safer sourceCmdWithConsumer.

Also update the tests while we're at it.