Switch to the new automagic beta numbering scheme.
* configure.ac: Add all the required m4 magic.
This also removes the hack to allow custom version numbers which are
not considered a development version. A custom version number can be
done anyway by simply setting the version to it and tag the release
with it.
This is a backport from master including the later patch to use
rev-parse.