gitapply.sh: Add license, check for dependencies before proceeding, several smaller improvements.
gitapply.sh: Replace regular expression with with bash substring at some places.
gitapply.sh: More regular expression replacements.
gitapply.sh: Move gitsha1 algorithm into separate function.