tessel/firmware — pull request #122 by johnnyman727 (2014-12-16 19:49:18+00:00)
Title: Cleans up wifi events and fixes disconnect emission

This PR fixes an issue where the `disconnect` event was being called if the Tessel was connected to wifi prior to the script starting.

In fixing the issue, I also cleaned up a bunch of the event emission code. It had a lot of confusing `removeAllListener` calls in order to save users from attaching too many listeners.

I believe the traditional design in Node.js is to have as few sources of event emission as possible, and just add a `.once('event', callback)` each time a new party is listening.