Fixed up CGI to remove debug stuff.
Added initCGIState as shortcut to initialising CGI state in client programs