src/server: refactoring to isolate dependencies on the cgi/fastcgi packages