Refactor MailSettings controller

- Do not store the password automatically (fixes https://github.com/owncloud/core/issues/11385)
- Refactor to AppFramework
- Add unit tests
Fair enough, will adjust it later and also make the unit tests compatible with our ancient PHPUnit version.