Extract IM functionality into a node module

The CLI is changed to use the newly introduced library. The protocol did not change, so you should be able to chat with previous clients too!

TODO:

- [ ] Allow using `/to [nickname]` for an established connection
- [x] Using `/who` crashes when connected to a buddy
- [ ] `/to [nickname]` is accepted, but crashes when sending a message