Change imaplib2 lib used, refactoring error checking into decorators, etc.