Put DB encryption key methods in TSEncryptedDatabase

This moves all methods related to the DB encryption key into TSEncryptedDatabase, in order to hide them from the outside as they are strictly internal to the DB.