Rewrite version getter entirely.

Use composer branch-aliases.
Add normalization support so that the output is always in the form "a.b.c.d"
where each part is a number. Strict order is kept ("1.0.0" < "1.0.0-patch1").
Add a new variable named "normalizedVersion" in build.xml with the normalized
version.