Socket type in options and sent during handshake.
Added decoder.rs and msg.rs, can now receive simple messages. Also:

 * use map_err to replace wrap_io_error
 * added options.maxmsgsize