Added support for thread id, fixed imap extensions on ruby 1.9.3 and optimized the message methods

Please read commit messages