Start server only if instance is allocated
Code formatting changes
Change listening socket to NONBLOCK
Replaced blocking sockets with multiplexing