Refactor MailSettings controller

- Do not store the password automatically (fixes https://github.com/owncloud/core/issues/11385)
- Refactor to AppFramework
- Add unit tests
Basically: Make a static call if it is declared static, otherwise create an instance. Everything else is a hack.