Fix version generation

This adds version generation in a more portable manner, requiring only
Git for the most basic meta-data. This allows us to generate versions
properly on Windows without requiring a full GNU coreutils installation

Change-Id: Ic10b9a4a76071c8b3cbeb4a8032ecb6ca5a61c31
Reviewed-on: http://review.couchbase.org/43420
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Subhashni Balakrishnan <b.subhashni@gmail.com>