Version 1.0: Heavily borrowed server.c

Currently compiling and running. Largely untested.