Added callback to connect() method, and use setImmediate() to call callbacks.

Also, added setImmediate() calls to return errors for unimplemented methods.
Merge pull request #2 from Morgul/callbacks

Callback cleanup