Add display of cause exception.

Also fixed tests where assert_raises interacted badly with capture_io.
Allow the exception/cause test to work with older Rubies.