calcgrade bugfix and config file improvements

This fix is in compliance with your specifications.
If branch is empty, it is set to the branch that HEAD tracks, which is essentially the `default` branch that git clones.
The rest is as it should be.