Sooo... I just set $preferred_programming_language = "Python" and hacked away. This is the result. Sadly, I couldn't properly test ist, because even with just about 280 out of the original ~20.000 files, Calibre chokes and dies horribly while creating the ePub output. But, at least it should create a HTML file as specified in the link Kovid provided.
The script expects the four files "header", "footer", "prefix" and "postfix" to be in the same directory as the HTML files. (Thus, to use, you need to extract your ZIP to a directory and put the files I attached inside the same directory.) The four files I mentioned contain the beginning and the end of the HTML file together with the text that's prepended and appended to the individual TOC entries. The script expects two parameters, the first one being the filename of the output file, the second one is the filename of the index file, which will go on top in the TOC. If you don't want to use an index file, just misspell the file name, the script shouldn't care.
Please be aware that this is somewhat kludged together (For you Python savvy folks out there, please don't hit me!) and may or may not work. There's no graceful error handling, scratch that: there's no error handling, so horrible, horrible things may or may not happen.