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!
Fix profile creation
Fix the CLI's /who command
Merge pull request #2 from aflatter/library

Extract IM functionality into a node module