The only piece from getcgi.c that anything other than the CGI needs is
the code to escape a UID. Move that into keyindex.c and shuffle the CGI
routines off to the subdirectory. The escaping routine could do with a
lot of improvement, but this is a start in terms of cleaning things up.