Implemented new SQlite-based historic data system.