Make a start at genericising things.  Change from upload CGI to command line, and from in-place generation to local site/ directory.