Fix version script to use git revision. Fixes #1

Expanded the version script (responsible for creating and updating
build_version.h, which contains the date and version string). Apart from using
bzr and svn revision numbers, it can now also get the current Git revision
from an existing .git folder. This includes widening of the variables for the
revision from mere numbers to strings. Currently a git revision string will be
the word "git" followed by the first 8 digits of the current commit's SHA1.
Add function to extract bzr rev from git tags.

Added a function which can extract the last merged-in bzr revision from
existing tags in Git. These tags must be named like "bzr<rev>", that is,
the word "bzr" followed by the revision number. The function minds both
the tags in the .git/refs/tags folder and in the .git/packed-refs file.
Move generation of Git rev string into function
Move pack-ref search to function; add comments

Moved the search for a ref's SHA in the packed-refs file into a function
(getGitSHAFromPackedRefs) and added some documenting comments to
getGitRevision().
Also removed an unused variable from getLatestBzrRevFromGitTag().
Improve listDir()

Fixed up the listDir function (formerly spelled ListDir), including these
changes:
 - throw out unneeded params (callback, directories): we never want to do a
    callback here and we never want to get directories listed
 - remove absolute path prefix from the resulting list, since we are only
    interested in the file names
These changes have been tested on linux and win32, and seem to be working.
Fix whitespace (spaces instead of tabs)
Add some comments, extract getRevString() function
Extract {process,writeout}BuildVersionFile functions
Merge remote-tracking branch 'nevik/master'