Better handling of globals. Refactored main() slightly.
adding server.c/h - starting to listen on a port - does not compile yet