reorder command-related code (no functional change)
reorder command-related code (no functional change)

trawick/ct-httpd,trawick/ct-httpd,tomrittervg/ct-httpd,tomrittervg/ct-httpd,tomrittervg/ct-httpd,trawick/ct-httpd