Begin a rewrite of MHng

Last time I started with the IMAP side of things, this time I'm
instead going to start with the database side.  With any luck this
will allow me to end up with a significantly cleaner implementation,
as the IMAP stuff resulted in some silly designs.

The real goal of all this is to deal with the fact that MHng is really
fragile right now.