Added some abstraction funcs to socket FFI.
Reimplemented :connect() using FFI
Added is valid_ipv4 func
Adapted test to fit slightly changed API.