No change in logic, just moved things around to make more functions static.

(cherry picked from commit 92301809d5d79ef6cb40a1919cef8959d1d5778b)

Conflicts:
	cf-serverd/cf-serverd-functions.c