refactor generate-git-snapshot

* modify the changelog when building "$branch", otherwise the
  package version wouldn't increase and look like a tag [closes #38]
* when using "none" as tag setting then ignore the request for building
  from tag, this supports Jenkins jobs with "branch" *and* "tag" setting
  but having "tag" set to "none" as default
* support setting $SOURCE_DIRECTORY instead of hardcoding "source" as
  default source directory
* follow symlinks when restoring debian/changelog so the file gets
  restored more reliable
* restore debian/changelog *before* changing back to original branch,
  otherwise git might refuse to do the switch if data has been modified
  in the working directory
* retrieve version information *after* checking out the according
  branch/tag, otherwise we might end up with the wrong version number
* move code into functions

Development sponsored by Sipwise.com.