another refactor of server code, now using mostly constructors instead of init(...) methods
manual merge