Refactor MailSettings controller

- Do not store the password (fixes https://github.com/owncloud/core/issues/11385)
- Refactor to AppFramework
- Add unit tests
I cannot inject it into the controller as this would break backwards compatibility, but I can use \OC::$server->getConfig() here. Will adjust this.