Codebase rewrite to fix multitude of problems with previous server.