Add a release script

The Makefiles were mostly filled with a complex shell script written in
m4sh. Moving that out into a separate script helps debugging and
compatibility, and in general makes life better.
We're not actually using this or any of the intermediate ones below anywhere anymore. If we want to keep these around though, we probably need to change the interface of this script. Thoughts?