Added more peer management logic

- added more peer management logic
- Reorganized peers.js
- added mor tests
- added mor packet validation
- updated docs