store: implement lowerencode in C
pathencode: add a SHA-1 hash function

This will be used by an upcoming patch.

This calls out to the Python hash implementation.

An earlier version of this function implemented SHA-1 directly, but
the amount of extra code didn't seem like a good tradeoff compared
to the small big-picture increase in performance (long paths are
uncommon).
pathencode: implement the "mangling" part of hashed encoding in C

This will be used by an upcoming patch.
pathencode: implement hashed encoding in C

This will be used by an upcoming patch.
pathencode: implement both basic and hashed encoding in C
store: switch to C-based hashed path encoding