adds wifi events from js

Goes with https://github.com/tessel/wifi-cc3000/pull/1
the indentation doesn't make sense? Where are the braces around the if statement?