add additional unit tests, fix bugs in GitRepository and SvnRepository, code cleanup

@cclerget: I did some work on top of your PR, mostly w.r.t. adding unit tests for the untested `GitRepository` and `SvnRepository` classes on top of your work contributed via https://github.com/hpcugent/easybuild-framework/pull/913

Can you take a look at this, and eventually merge it in so it gets included in PR https://github.com/hpcugent/easybuild-framework/pull/913?