Port Fixes #1246
Fixes #1242
Fix the build
Fixes #1227
Firt pass for fixing #1243: Make sure WebSocket Support is properly detected
Fixes #1266
Fixes for #1243 #1191