Moved setupEvents from the prototype and into a function which is called on connect, that sets up all the other event listeners
Moved connect event back into it's own function, it was breaking tests