Switch from c wrapper to ffi

* socket factory shortcuts to bind and connect
* sockets handle marshaling