Update wifi.js

Changes quite a bit of the script, included namespacing