Re-order functions in server main

Alphabatize functions for easy navigation.