Move server's main function to C instead of being run from Lua interpreter