Modularized some files
Several changes that made the socket connection work