Close IMAP session at the end of Mongo request and processing of unsorted emails; Commit debugging code for use in resolving other bugs