Generate a standalone shell script

The tests are broken, but this seems to work.