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

This patch is still under WIP.
I was wondering do we still need this function as now we have separated scripts for each panel. It seems the logic in this function is less common (many conditional checks) and we better move the code to its belonging script.