Cleaned up some of the server and socket mud. Split main into a game loop as well so logic could be moved there later.
final revisions.