Refactoring: use an interface for the common business logic

The whole reason for the asWidget() method is to enforce the type correctness
here. Any solution which employes a static_cast or a reinterpret_cast is evil,
and one cannot use virtual inheritance with multiple QObject instances due to
the moc's limitations, according to the docs.
Add UI hints and prevent saving a configuration which definitely is not going to work

v2: Check more fields -- thanks to Caspar for review.

BUG: 324850
REVIEW: 113886
IMAP: Make sure that ENABLE always preceeds SELECT

The tasks were created at the right moment, but they weren't actually started
soon enough.

fixes #611
REVIEW: 113888