In reply to Tom Kari.

Yes, I think it needs a bit more "hardening". In addition to what you said, it would need to become more efficient for very large data, as it reads all records into memory and builds a character string (the program) all at once. It would need to change to page the records out as it reads them so that we don't hit a memory exception.

And I think some of these things would need to be optional, as they are tradeoffs against code readability.