Use rugged for a better git discovery

The previous git discovery was buggy. If failed outside of git managed directories and prompted some stuff to STDERR. Rugged provides a better git based interface for git discovery.