Add support for remote git repositories

Using github API.

Still need to unify the interfaces so it can work using the new code, but this PR is already big enough.