TCP Support functions to deal with reply, request and connection information

I'd restyle this block to:
```erlang
handle_cast({send, #transport{socket = Socket, ssl = Ssl, compress = Compress}, 
             Elem}, #state{on_request = OnRequestFun} = State) ->
    Reply = case {Ssl, Compress} of
                {true, _} ->
                    ssl:send(Socket, exml:to_iolist(Elem));
                {false, {zlib, {_,Zout}}} ->
                    Deflated = zlib:deflate(Zout, exml:to_iolist(Elem), sync),
                    gen_tcp:send(State#state.socket, Deflated);
                {false, false} ->
                    gen_tcp:send(Socket, exml:to_iolist(Elem))
            end, 
    OnRequestFun(Reply),
    {noreply, State};
```
Apart from that, the whole PR is peachy :)