Added preference upgrade script
Fix a couple of TODOs
Fix selected account on AccountsFragment
Ported log fix from master