Enhancements to sh template

This PR includes two significant changes:

* If this version of the code is already in current:
  * If not forced, do not install the code
  * If forced, rename the old directory and write out a new one

* Ignore functions in environment when saving .install-metadata, due to an issue with FPM 1.25.29-31 and Bash 4.3.27