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