Redesigned and Modular code for Server connection and other communication

Status: Working
Bugs: 0