Fixed copyright notice
Enabled STARTTLS and SSL support

Registered in the factory for the network connection the urls for
STARTTLS and SSL.
Added missing permission

The application needs to check the network state receive mails. The
permission was missing from the manifest.
Initial refactoring of IMAP code

The code was copy/pasted to K9. This commit re-organizes the code to
better suit our needs. The refactoring is not yet complete, more cleanup
is needed.