Merge pull request #4 from mnicky/master

creating directories in a portable way
Open all files in binary mode
Handle commits for submodules in a tree, fix #2

Previously, only 'blob' and 'tree' objects were handled in a tree.
When a git repository contains submodules, they are stored in the tree
as a 'commit object' (mode 16000). While checking out the tree, an
empty directory is created for each such commit.
Fix extracting files on Windows

This little unnoticed typo caused that binary files containing the 0x1A
byte (Ctrl-Z - end-of-stream) opened on Windows were truncated.

http://programovani.tumblr.com/post/40023045315/kdyz-hledate-bug-prochazite-kod-az-ten-preklep
Create required Git files and directories in `git.repo.create`