Cleaned up + Discovery

Cleaned up the source code mess, added configuration variables, added a
discovery function to find a server in the LAN