Handle directories, use git hash-object in prescript, and escape paths in html.