Rewrote P2PNode unit tests

Rewrote P2PNode unit tests to follow new architecture, and added a whole
bunch for previously untested methods.