cleaned up peer.js, renamed index, added message parsing

- cleaned up peer.js. More consistent use of `internals`
- renamed in index.js to network.js
- added message parsing for several more messages
- updated docs