use prototype to attach methods to socket wrapper

* renamed recv event to data to match the convention in node