Move more templates out into separate files.
Clean up after running tests, by closing chatboxes.
More templates refactored into separate files.