VCS generalization and efficiency refactors

Subsumes the changes in https://github.com/warner/python-versioneer/pull/28.