nullifies the websocket object when destroyng native WebSocket object

On android 4.0.x default browse(not chrome), the WebSocket is a dummy
object and makes things break when trying to detect the correct object
presence -
remove utility functions and export them into another module
nullifies the websocket object from the window

related to dummy WebSocket object on some browser(android 4.0.x default
browser)
todos and comments