Update handling of version numbers.

- Use git merge rather than git pull, since we've already done
  a fetch at this point.
- Don't overwrite the VERSION file.
- Use the contents of VERSION as the version, with minor cleanup
  (version numbers cannot contain spaces or slashes).
- Prepend the build date to the version for nightly builds,
  so the packages are upgradeable.