Fix tests and improve coverage.

Engine tests don't work out of the box so fix them here and improve coverage to
test various new bits of functionality that have been added since original
generation.