Update git-based version handling.
Add slugify function.
Handle bytestrings more elegantly in calc_sha.