Get rid of context and used a global context instead
Disconnect from peer on leave
Close channels
Delete the peer after disconnecting from it
Unbind from the local endpoint on disconnect
Separated commands and events channel

Now it's safe to call API from anywhere and sending commands through
commands channel protects us against accessing/modifying the shared memory
simultaneously
Fixed a typo
Disconnect from peer before deleting it