Refactored server files into more discrete modules