Use Filemode type in TreeEntry and IndexEntry

Fixes #121
Merge pull request #123 from ry/master

Use Filemode type in TreeEntry and IndexEntry