move sockshell code where it belongs

Also fix some warnings