Revamp EncryptedDatabase pt1

Simplify/clarify EncryptedDatabase’s API with databaseCreate and
databaseUnlock
Move DB creation methods from Cryptography.m to EncryptedDatabase.m for
less back and forth between the two classes
Coding style and group private methods together
Let the user know if they entered an invalid pw
Add basic unit tests for EncryptedDatabase
Add a databaseErase method
Add databaseLock
Fix test query
Tweak databaseErase and close the dbQueue when locking
More unit tests
Working unit tests
Add error handling to databaseCreate + unit tests
Tweak unit tests
update preferences when erasing a DB
Add tests for databaseWasInitialized
Tweak databaseLock to avoid dangling references

Setting SharedCryptographyDatabase to nil would result in crashes if
some code still has a reference to the DB
rename databaseWasInitialized to WasCreated
Add database isUnlocked to clarify the flow
some comments
Add unit test for DB unlocking with corrupted keychain
tweak databaseCreate