server part improvements

Server part almost totally re-written. Test functions deprecated. GUI
added, but not functional.