Adding utility functions for handshaking, extending peer to shake hands, fixing docstrings