Change the way the version code is computed.

This commit specifies (as a comment) how the version name and version
code should be set, so that it is easier:
(a) to map a version code to a version name
(b) handle alpha and beta channels correctly
(c) distinguish builds on different branches