Improve `test` subcommand, including showing stats at end.