Added support for authentication

- Added support for authentication 
- Fix EventEmitter inheritance
- Logging is now optional: client.debug = true;
- "ready_callback" now gets 2 params: err and clientInstance