Fixed some bugs

* Fixed copy-paste errors/ typos
* Improved logging
* Peers now get killed explicitly on SIGTERM and SIGINT
Added mocha tests