Reworked architecture

Moved to a more client-server base, moved lots of methods from various
classes into Server.java.