Refactored module code
Initial WebSocket implementation using ws