Tests cleanup

Make sure remote is wiped between tests
Prepare whole test_repo structure at the start so tests are independant
Fix detection as tag of delivered ref

A ref name contained in a tag name woule have been considered a tag...
Replace 2>&1 with &>, fix git --version stderr redirect in remote git version check