* Validate sqlite database on startup and move away if corruption is detected. * do not switch context in test -- its all sync
* Re-organize recorder * Fix history * Fix history stats * Fix restore state * Lint * Fix session reconfigure * Move imports around * Do not start recording till HASS started * Lint * Fix logbook * Fix race condition recorder init * Better reporting on errors