Debian package versions calculated according to which branch is used.
Moved that to its own function.
Tidied up script. (remove tabs, etc.)