Some refactoring in prep for adding secure email. Database corruption stability is poor, but less worried about that and more worried about features.