Start of custom Socket class

Should make it easier to allow porting to linux