Revise how version strings are computed

With this commit, when possible setup.py tries to build a version string
based on the last git commit id and, if available, the commit's tag
name.
(cherry picked from commit 5d6f42b10324403cb7b997dad17aa6327a75a4aa)
Fix MANIFEST.in file
(cherry picked from commit 11db8d9ae2bf7dbe6a62461a379384881882c852)
Improve logic to set version
(cherry picked from commit a6d1f33ebcf7dde4f5acdda5426889edd531f3d0)