v0.6 Major refactor for easier repository management and cleaner code

Git repository management spearated into class, and extended by adding
dependency management in a subclass. This also cleaned up the overused
chdir statements, by using --git-dir command line option of git.

Additional changes:
- Fixes subtree handling: you can now issue git dependencies commands
from subdirectories
- Fixes submodule dependency management: you can now use git-dependencies
in submodules
- Fixes a bug in clone: if ref is a correct branch, cloning the dependency
now clones that specific branch instead of cloning master and switching
branches
- Additional fixes and maintenance