Add some debugging code. Add tentative Valgrind support. Change singleton usage to address issue 5526 by making singletons eternal. Add Valgrind tests. Update docs to match. Refs #5526.