pygitweb: have helper functions take pure pygit2.Repository as input types, such that we can move helper functions to pygitweb; Not sure that I like how this turned out so stashing it for now.