Allow using external repo as template for new repo.

When creating a new repository, you can now define a template repository on which the new repository should be based. It will inherit all commits, branches and tags of that repository.