Modifications to engines.

I've modified the regexes used in these scripts to make them more accurate.  While the old ones worked just fine, a pending change in my texrenaming branch required some refinement.  These changes are fully backwards compatible, so I'm using them to familiarize myself with features of git (in particular getting changes from my development fork to the main project).

I also made some edits to the comments to make it easier to understand what each step is supposed to be doing.