Added a "heartbeat" file that is updated every time there is successful poll of IMAP inbox that way we can detect when it stops working. Also changed the Re-login algorithm so that *both* connect and login must succeed together it will keep retrying the two actions together rather than creating a bogus failed connection and forever failing on the attempt to re-login over and over again.