Removed global flags variable in server.d
Refactored out request handler code into their own functions
Replaced if elseif with switch
dtest generated ut.d