Split out dialog tests into a DialogTester. Adjusted dialog tests accordingly. A few bits here and there in libraries to aid writing tests.