Bug 800402 - [email] UI: Show the number of unread messages in the message-list header after the folder name

You're running up against some permutation/technical debt here that I think we need to pay down.  For this line specifically, we do not want to be doing this as a transparent upgrade in all cases.  We want to be initializing this at folder-definition time and compelling an upgrade to include this count, one way or the other.

The existing canonical persistedFolderInfo docs can be found at https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/data/lib/mailapi/worker-support/maildb-main.js#L407 and they basically don't say much of anything.  If you mash them up with our documentation on MailFolder in mailapi.js at https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/data/lib/mailapi/mailapi.js#L232 we can probably figure out what is going on.

The other, limited, ugliness we have here is that the persistedFolderInfo structure-constructing code is duplicated in activesync/account.js and composite/incoming.js and test_folder_storage.js when it is faking things.  I think what we want to do here is follow the lead of what we did with db/mail_rep.js (where we have constructor functions with positive JS engine side-effects in terms of type and shape consistency) and create a db/folder_info_rep.js.  Maybe "folder_info" is  not the right stem, but I'd like to express that it's not the same thing as what's inside FolderStorage.

I'm interested in @mcav's opinion on this (specifically folder_info_rep) in particular.  I'll create a comment on the bug for us to discuss the upgrade ramifications since that's something we'll want a better/more cross-linkable/etc. historical record on.