Add support for clients to protocol module

The protocol module now supports the client side of handshakes, as well
was writing client frames.  You can now specify which
subprotocols/extensions to use in a server response (via the on_open
callback).

Also change base64_encode_blockend to add a null to the end of the
string rather than a newline.

Also add a copy function and a copy constructor to darray.