Another large update for database encryption. Seems to be basically working now.