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

This patch is still under WIP.
It seems that we only use this function in `/js/panels/wifi_join_hidden/panel.js`, could we move this function to `/js/panels/wifi_join_hidden/panel.js` ?