(Attempted) history keeping via database.

Change-Id: Ia8c3a3006c51d0330facb54a365ba80746d0b512