Introduce database functionality into KDS

Add database setup and initial testing into Key Distribution Server.
Also adds a migration script.

Change-Id: I22e914ef1ca6ec8217d131c073261b309d9f637e