optimize version.sh and update_version.bat

- version.sh already used bash-specific syntax, and MSYS uses bash for sh, anyways,
  so make the script a real bash script and properly call it using bash.exe
- optimze bash syntax (avoid external tools, don't use echo -e, use $() instead of ``, lowercase vars, ...)
  see http://mywiki.wooledge.org/BashFAQ / http://mywiki.wooledge.org/BashGuide
- only use plumbing git commands instead of porcellain commands in combination with external tools
- the script is never passed an argument, so remove the $1 check