Use 'git describe' for version numbering. This utilizes repo tags and should simplify things.
Merge pull request #230 from decrement/master

Streamline Version Numbering Using Tags and Add Commit Hashes