Add is_valid_git_refname and is_valid_git_sha1

Given the great variability that exists between versions of git, this
functions validate the output returned from the git commands used to
retrieve the current branch name (refname) and the current SHA.

The function get_qiime_library_version was updated to make use of these
functions.

The module was updated accordingly.

This should fix issue #603.
Merge pull request #609 from ElDeveloper/git_version

Add is_valid_git_refname and is_valid_git_sha1