Fix for git shallow clones

This fixes the bug described in #1920. It uses a couple of approaches to check if shallow clone is supported

1) It maintains a list of known domains that support shallow clone and checks if url belongs to supported domain 
2) If the urls domain is not listed in list of known smart domains, it tries parsing response headers to detect of shallow clone is supported

Tests for new functions have also been added.

---
fixes #1920
fixes #558