Support for rolling logs

Adds support for rolling logs. When the log is rolled over diagnostics information is added to the top of the new log.
@digitalstain not quite: we use dots to signify setting category, and underscore within names. So it's consistent with the rest.