reastructuring low level code

 * move reading socket to separate file
 * reading socket's owner class is a template parameter
 * move socket utils to separate file
 * move socket connection to socket utils