Various stuff while reading the code

This is various things that came up while reading the code.
Please see individual commits.

On another topic I think it would be nice to restrict the validity of ids to the same of repository name. That would allow to drop the sha1. But I you keep the sha1 it would require to escape the id in getFilename.