Use Filemode type in TreeEntry and IndexEntry

Fixes #121