Bug 973466 - [settings] refactor wifi panel with AMD pattern

This patch is still under WIP.
If this function is only called within this module definition, I would suggest to add a `_` prefix marking that it is a private function. And we can also remove `_isWifiContextInitialized`.