Bug 800402, Bug 888955 - Track unread messages and do database upgrades

Land https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/315

I had some minor review fixes that I've folded into the second patch.  I've also updated the authorship of :awiss's first patch to use the same mail address as the second patch since I think the MoCo mail address may go away soon and the MoCo address doesn't seem to properly map to :awiss's github account.