revamp using custom websocket libraries, and modularizing server - files appended with 2