Check for web socket support and move JS functions

Logs lack of web socket support
Merge pull request #12 from ttfnrob/master

Check for web socket support and move JS functions