Continued refactoring. Got the server starting up without error, but haven't tested any further yet.