Add TTL to database entries.

A migration path is necessary, since the TTL module uses a very
similar key structure to one of our key types. To prevent a lot of
erroneous delete requests being generated in the future, I'm moving
to a different (non-conflicting) key structure that also solves some
bugs I thought of with the current one.

To do the migration, every new database entry will be added twice,
once with each key structure. Once we can be sure that all keys in
the DB have both key structures, we can delete the old version and
update the getSummary query.

I also need to write a script to delete all the keys from before TTL
was added, but I can do that as part of the future migration.