Check for web socket support and move JS functions

Logs lack of web socket support - should prevent errors in older browsers and fail gracefully.