Initial version of the server rewrite by saturnu.