Renamed 'attributes' of tree-entry to 'filemode'.

This should unify the naming convention.
Unified naming of tree-entries in createTree.

This allows the use of repo.tree to be passed to createTree.