Improve stratum message handling

Prevent the case where multiple messages are chunked together without being processed (occasionally leading to the buffer growing too large and the client being kicked).

Recognize messages consisting only of spaces as malformed.
Some work on the p2p system
Fix several bugs in peer.js and enable it to successfully connect to a peer (tested with bitcoind).
Merge pull request #59 from LucasJones/master

Fixed p2p system