Credential Gem: LoginScanner - auxillary/server/capture/imap.rb

Refactor 'auxillary/server/capture/imap.rb' to support the Metasploit Credential gem.  Also, a few small changes have been made to make the Ruby a bit more compliant with current standards.

**Verification**

- [x] check out the metasploit-credential branch by using the instructions in the section 'Check out the electro-release branch' at the link below:
      https://github.com/rapid7/metasploit-framework/wiki/Metasploit-Loginpalooza


- [x] ````msfconsole````
     Run this as root to bind to port 143
- [x] ````use auxiliary/server/capture/imap````
- [x] ````run````
     - [ ]  Configure an IMAP client to connect to your msf host
     - [ ]   __VERIFY__ that the configured credentials are echoed to the console
- [x]  ````creds````
- [x]  __VERIFY__ that credentials configured in the IMAP client and echoed to the console are found in the results from creds