Rewrote testing infrastructure to use catch_warnings infrastructure.