lib: make connection type configurable

It's now possible for the caller to create the socket/server object that
Uhura uses.  First step in making it possible to use SSL/TLS encryption.