Move DB master key code to EncryptedDatabase